add README.md

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2020-02-06 12:55:35 +01:00
parent db4510cbed
commit 48ebe2d30f
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
2 changed files with 32 additions and 0 deletions

32
README.md Normal file
View File

@ -0,0 +1,32 @@
# 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`](https://en.wikipedia.org/wiki/Linear-feedback_shift_register) repo.
It uses the [Linear-Feedback Shift Register](https://en.wikipedia.org/wiki/Linear-feedback_shift_register) algorithm on the 8 least significant bytes of the `X` of [ECDSA](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm) public key.
# Building
You can update the contents of `dist` folder by running:
```
yarn test
yarn build
```
# Usage
The library exports just one method:
```js
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!')
}
```

0
src/main.js Executable file → Normal file
View File