moar comments
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
1c8c30c3ae
commit
28c86e7f41
|
@ -15,6 +15,9 @@ const ONE = BigInt(1)
|
|||
const UINT64 = BigInt("0xFFFFFFFFFFFFFFFF")
|
||||
|
||||
/**
|
||||
* Linear-Feedback Shift Register algorithm
|
||||
* For details: https://en.wikipedia.org/wiki/Linear-feedback_shift_register
|
||||
*
|
||||
* This implementation is based on the GoLang one in status-go:
|
||||
* https://github.com/status-im/status-go/tree/develop/protocol/identity/alias
|
||||
**/
|
||||
|
|
|
@ -48,8 +48,10 @@ function chatKeyToChatName(pubKeyStr) {
|
|||
let seed = pubKeyX
|
||||
let poly = BigInt(184)
|
||||
|
||||
/* Linear-Feedback Shift Register */
|
||||
let gen = new LSFR(poly, seed)
|
||||
|
||||
/* Pick words based on modulo of generated number */
|
||||
let adjec1 = gen.next() % BigInt(adjectives.length)
|
||||
let adjec2 = gen.next() % BigInt(adjectives.length)
|
||||
let animal = gen.next() % BigInt(animals.length)
|
||||
|
|
Loading…
Reference in New Issue