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
$ node
Welcome to Node.js v14.16.0.
Type ".help" for more information.
> const { hash } = require('argon2-browser/dist/argon2-bundled.min')
undefined
> hash({ pass: 'password', salt: 'somesalt' })
Promise { <pending> }
> (node:10078) UnhandledPromiseRejectionWarning: ReferenceError: atob is not defined
at /.../argon2-browser/dist/argon2-bundled.min.js:1:8174
at /.../argon2-browser/dist/argon2-bundled.min.js:1:8283
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
argon2-browser version is 1.18.0
Seems that atob is not available in node, but it is used in
According to https://nodejs.org/ node@14 is still LTS version, I think it should be supported by default. atob can be easily replaced with Buffer in node. I was going to sent a PR with something like:
function decodeWasmBinary(base64) {
+ if (typeof Buffer === 'function') {+ return new Uint8Array(Buffer.from(base64, 'base64'))+ }
const text = atob(base64);
const binary = new Uint8Array(new ArrayBuffer(text.length));
for (let i = 0; i < text.length; i++) {
binary[i] = text.charCodeAt(i);
}
return binary;
}
Thanks for solving the previous issue!
argon2-browser version is 1.18.0
Seems that
atob
is not available in node, but it is used inargon2-browser/lib/argon2.js
Line 97 in 63cda65
The text was updated successfully, but these errors were encountered: