From 8ceb7d7ee544596a03261b2fc3ec0340343ec96a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Miro=20Mets=C3=A4nheimo?= Date: Wed, 27 Apr 2022 22:13:08 +0300 Subject: [PATCH] Version 1.4.3 * Revert back a change regarding entropy length --- README.md | 2 +- lib/bip39-mnemonic.ts | 6 +++--- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f2a8403..ede22d8 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ npm install nanocurrency-web ### In web ```html - + diff --git a/lib/bip39-mnemonic.ts b/lib/bip39-mnemonic.ts index 0ec34dc..7539247 100644 --- a/lib/bip39-mnemonic.ts +++ b/lib/bip39-mnemonic.ts @@ -16,7 +16,7 @@ export default class Bip39Mnemonic { static createWallet = (entropy: string, password: string): MnemonicSeed => { if (entropy) { if (entropy.length !== 64) { - throw new Error('Invalid entropy length, must be a 64 byte hexadecimal string') + throw new Error('Invalid entropy length, must be a 32 bit hexadecimal string') } if (!/^[0-9a-fA-F]+$/i.test(entropy)) { throw new Error('Entopy is not a valid hexadecimal string') @@ -24,7 +24,7 @@ export default class Bip39Mnemonic { } if (!entropy) { - entropy = this.randomHex(64) + entropy = this.randomHex(32) } const mnemonic = this.deriveMnemonic(entropy) @@ -45,7 +45,7 @@ export default class Bip39Mnemonic { static createLegacyWallet = (seed?: string): MnemonicSeed => { if (seed) { if (seed.length !== 64) { - throw new Error('Invalid entropy length, must be a 64 byte hexadecimal string') + throw new Error('Invalid entropy length, must be a 32 bit hexadecimal string') } if (!/^[0-9a-fA-F]+$/i.test(seed)) { throw new Error('Entopy is not a valid hexadecimal string') diff --git a/package-lock.json b/package-lock.json index b4cb72f..f402b4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nanocurrency-web", - "version": "1.4.2", + "version": "1.4.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0d2c630..cfdc2d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nanocurrency-web", - "version": "1.4.2", + "version": "1.4.3", "description": "Toolkit for Nano cryptocurrency client side offline integrations", "author": "Miro Metsänheimo ", "license": "MIT", -- 2.34.1