mirror of
https://github.com/oed/seedsplit.git
synced 2026-01-10 05:07:57 -05:00
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
19 lines
392 B
JavaScript
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)
|
|
})
|