Better document magic numbers

pull/386/head
sachaaaaa 6 years ago
parent 16e51a2c7a
commit 0e61ab8ccc

@ -523,7 +523,10 @@
});
},
async generateMnemonic(language = 'english') {
const seed = window.Signal.Crypto.getRandomBytes(16);
// Note: 4 bytes are converted into 3 seed words, so length 12 seed words
// (13 - 1 checksum) are generated using 12 * 4 / 3 = 16 bytes.
const seedSize = 16;
const seed = window.Signal.Crypto.getRandomBytes(seedSize);
const hex = StringView.arrayBufferToHex(seed);
return mnemonic.mn_encode(hex, language);
},

Loading…
Cancel
Save