Files
seedsplit/index.js
Denis Shulyaka d0cf927606 Switch to dsprenkles/sss-node library
1. Replaced secrets.js with dsprenkles/sss-node
2. Each shard is a number followed by exactly 24 words
3. If the initial seed is not 24 words, then the shard number is prefixed with a character indicating the seed length
4. The lib/seedsplit.js functions now return a promise
5. Shards are not backwards compatible with the current seedsplit version
2018-05-12 00:55:00 +03:00

19 lines
392 B
JavaScript

const bip39 = require('bip39')
const seedsplit = require('./lib/seedsplit')
//let m1 = bip39.generateMnemonic(256) // 24 words
let m1 = bip39.generateMnemonic() // 12 words
console.log(m1)
let sm = seedsplit.split(m1, 3, 2)
sm.then((x) => console.log(x))
let m2 = sm.then((x) => seedsplit.combine(x.slice(1)))
m2.then((x) => {
console.log(x)
console.log('Is correct:', m1 === x)
})