JavaScript library for generating Status Chat Names from Chat Keys
Go to file
Jakub Sokołowski 6b26e7314e
readme: fix link to status-go code
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-03-15 11:09:54 +01:00
dist generate a NodeJS dist, bump to 0.1.2 2020-02-10 21:39:17 +01:00
src add README.md 2020-02-06 12:58:10 +01:00
test add cases.go as example of source of test cases 2020-02-06 12:27:11 +01:00
.gitignore add gitignore 2020-02-06 10:31:39 +01:00
README.md readme: fix link to status-go code 2020-03-15 11:09:54 +01:00
package.json generate a NodeJS dist, bump to 0.1.2 2020-02-10 21:39:17 +01:00
rollup.config.js generate a NodeJS dist, bump to 0.1.2 2020-02-10 21:39:17 +01:00
yarn.lock add basic test 2020-02-06 10:55:01 +01:00

README.md

Description

This is a JavaScript library for convering a Status chat key ot a chat name.

Details

This implementation is based off of a GoLang one in status-im/status-go repo.

It uses the Linear-Feedback Shift Register algorithm on the 8 least significant bytes of the X of ECDSA public key.

Building

You can update the contents of dist folder by running:

yarn test
yarn build

Usage

The library exports just one method:

const StatusIm = require('./dist/status-chat-name.js')

let chatKey = '0x040bc5bdbd8edf82962b191e80541d7ca8868920b1b415fcd999d6bd723cbbcff17f34e1e6e0484c11d9c7c63b164878a6da3173a49ceaf5fea2faac98928f8a47'

let chatName = StatusIm.chatKeyToChatName(chatKey)

if (chatName != 'Defensive Impartial Impala') {
  throw new Error('FAIL!')
}