@xyo-network/bip39 2.92.2 → 2.92.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts.map +1 -1
- package/dist/browser/index.d.mts.map +1 -1
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts.map +1 -1
- package/dist/node/index.d.mts.map +1 -1
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -44,6 +44,7 @@ function assertEntropy(entropy: Uint8Array) {
|
|
|
44
44
|
export function generateMnemonic(wordlist: string[], strength = 128): string {
|
|
45
45
|
assert.number(strength)
|
|
46
46
|
if (strength % 32 !== 0 || strength > 256) throw new TypeError('Invalid entropy')
|
|
47
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
47
48
|
return entropyToMnemonic(randomBytes(strength / 8), wordlist)
|
|
48
49
|
}
|
|
49
50
|
|
|
@@ -114,6 +115,7 @@ export function entropyToMnemonic(entropy: Uint8Array, wordlist: string[]): stri
|
|
|
114
115
|
/** @deprecated use @scure/bip39 instead */
|
|
115
116
|
export function validateMnemonic(mnemonic: string, wordlist: string[]): boolean {
|
|
116
117
|
try {
|
|
118
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
117
119
|
mnemonicToEntropy(mnemonic, wordlist)
|
|
118
120
|
} catch {
|
|
119
121
|
return false
|