chore: use monorepo organization

This commit is contained in:
Rafael Taranto 2025-05-12 10:52:54 +01:00
parent deaf7d6ecc
commit a687827f7e
1099 changed files with 8184 additions and 11535 deletions

View file

@ -0,0 +1,19 @@
const bip39 = require('bip39')
const os = require('os')
function fromSeed (seed) {
const words = bip39.entropyToMnemonic(seed).split(' ')
let mnemonic = ''
for (let i = 0; i < words.length; i += 6) {
mnemonic += words.slice(i, i + 6).join(' ') + os.EOL
}
return mnemonic
}
function toEntropyBuffer (mnemonic) {
const hex = bip39.mnemonicToEntropy(mnemonic.split('\n').join(' ').trim())
return Buffer.from(hex.trim(), 'hex')
}
module.exports = { toEntropyBuffer, fromSeed }