You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i am running the browserify via command line browserify src/crypto/Mnemonic.js -p esmify --standalone mnembundle > src/bundle/MnemonicBundle.js
but i receive this error:
Error: Parsing file C:\Users\User\Documents\GitHub\AdrestusWallet\frontend-react-basic-app\src\crypto\Mnemonic.js: visitor[(override || node.type)] is not a function
at Deps.parseDeps (C:\Users\User\AppData\Roaming\npm\node_modules\browserify\node_modules\module-deps\index.js:519:15)
at getDeps (C:\Users\User\AppData\Roaming\npm\node_modules\browserify\node_modules\module-deps\index.js:447:44)
at C:\Users\User\AppData\Roaming\npm\node_modules\browserify\node_modules\module-deps\index.js:430:38
at ConcatStream.<anonymous> (C:\Users\User\AppData\Roaming\npm\node_modules\browserify\node_modules\concat-stream\index.js:37:43)
at ConcatStream.emit (node:events:525:35)
at finishMaybe (C:\Users\User\AppData\Roaming\npm\node_modules\browserify\node_modules\readable-stream\lib\_stream_writable.js:630:14)
at endWritable (C:\Users\User\AppData\Roaming\npm\node_modules\browserify\node_modules\readable-stream\lib\_stream_writable.js:638:3)
at Writable.end (C:\Users\User\AppData\Roaming\npm\node_modules\browserify\node_modules\readable-stream\lib\_stream_writable.js:594:22)
at DuplexWrapper.onend (C:\Users\User\AppData\Roaming\npm\node_modules\browserify\node_modules\readable-stream\lib\_stream_readable.js:577:10)
at Object.onceWrapper (node:events:627:28)
This is my whole code script:
var crypto = require('crypto')
var secureRandom = require('secure-random')
var Util=require("./Util.js")
const ALGORITHM='SHA-512'
module.exports =class Mnemonic{
#SALT_CHARS ;
#WordList;
#Strength
constructor(Strength) {
this.hash = crypto.createHash('sha256');
this.#Strength=Strength;
this.#SALT_CHARS = Buffer.from(['m', 'n', 'e', 'm', 'o', 'n', 'i', 'c'])
this.#WordList=["abandon", "ability", "able", "about"];
}
createSeed(mnemonic,passphrase){
if(passphrase==null){
throw new Error("Passphrase should not be null! Please enter a valid password");
}
let buffer_passphrase=Buffer.from(passphrase)
let SALT=Buffer.concat([this.#SALT_CHARS,buffer_passphrase],this.#SALT_CHARS.length+buffer_passphrase.length);
let derivedKey=crypto.pbkdf2Sync(mnemonic, SALT, 2048, 512, ALGORITHM);
return derivedKey.toString('hex');
}
create(){
let bytes = secureRandom.randomBuffer(this.#Strength);
let hashbits=this.hash.update(bytes).digest();
let binaryHash = Util.bytesToBinaryAsChars(hashbits).slice(0,this.#Strength);
let checksum=Util.charSubarray(binaryHash,0,(bytes.length/8)*8/32)
let entropyBits = Util.bytesToBinaryAsChars(bytes).slice(0,this.#Strength);
let concatenatedBits=entropyBits.concat(checksum);
var mnemonicBuilder=""
for (let index = 0; index< concatenatedBits.length/11; ++index) {
let startIndex = index * 11;
let endIndex = startIndex + 11;
let wordIndexAsChars=Array(endIndex-startIndex);
Util.arrayCopy(concatenatedBits,startIndex,wordIndexAsChars,0,wordIndexAsChars.length)
let wordIndex=Util.binaryCharsToInt(wordIndexAsChars);
mnemonicBuilder+=this.#WordList[wordIndex]+' ';
}
return mnemonicBuilder.trim().split(' ');
}
}
Any help how to resolve visitor[(override || node.type)] is not a function is this a bug?
The text was updated successfully, but these errors were encountered:
i am running the browserify via command line
browserify src/crypto/Mnemonic.js -p esmify --standalone mnembundle > src/bundle/MnemonicBundle.js
but i receive this error:
This is my whole code script:
Any help how to resolve
visitor[(override || node.type)] is not a function
is this a bug?The text was updated successfully, but these errors were encountered: