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
This is not a show stopper for me, but I thought I would mention it.
Steps to reproduce
"argon2": "^0.29.1"
I'm using this code segment in Typescript
let options = {
memoryCost: 15 * 2**10, // 15MiB, memoryCost is in KiB
timeCost: 2,
parallelism: 1,
hashLength: 32, // default
type: argon2.argon2id, // default
raw: false
}
let hash = await argon2.hash(newUser.psw, options)
Note: That because the 'type' I was using is the default anyway, just deleting the 'type' line avoids the bug.
You don't really need to reproduce the issue, just looking at the source shows the mismatch.
Expected behaviour
Typescript declared types should agree with internal dynamic check.
Actual behaviour
If I set id to an integer as required by the typescript type, it results in a runtime error when the type check fails in the serialize() function in index.js
If I set it to a string, the Typescipt compiler issues an error
TypeError: id must be a string
at serialize (/Users/james/GitRepos/WebMisc/RmaSite/dev/dbApi/node_modules/@phc/format/index.js:59:11)
at Module.hash (/Users/james/GitRepos/WebMisc/RmaSite/dev/dbApi/node_modules/argon2/argon2.js:68:10)
...
The odd thing, is that even with the error, using commonJs modules, it seemed to work, but when switching to use EJS (for other reasons), it started catching the error.
Environment
MAC
node: v16.13.0
typescript: Version 4.7.4
The text was updated successfully, but these errors were encountered:
This is not a show stopper for me, but I thought I would mention it.
Steps to reproduce
"argon2": "^0.29.1"
I'm using this code segment in Typescript
Note: That because the 'type' I was using is the default anyway, just deleting the 'type' line avoids the bug.
You don't really need to reproduce the issue, just looking at the source shows the mismatch.
Expected behaviour
Typescript declared types should agree with internal dynamic check.
Actual behaviour
If I set id to an integer as required by the typescript type, it results in a runtime error when the type check fails in the serialize() function in index.js
If I set it to a string, the Typescipt compiler issues an error
TypeError: id must be a string
at serialize (/Users/james/GitRepos/WebMisc/RmaSite/dev/dbApi/node_modules/@phc/format/index.js:59:11)
at Module.hash (/Users/james/GitRepos/WebMisc/RmaSite/dev/dbApi/node_modules/argon2/argon2.js:68:10)
...
The odd thing, is that even with the error, using commonJs modules, it seemed to work, but when switching to use EJS (for other reasons), it started catching the error.
Environment
MAC
node: v16.13.0
typescript: Version 4.7.4
The text was updated successfully, but these errors were encountered: