node-argon2 icon indicating copy to clipboard operation
node-argon2 copied to clipboard

Problem with typings

Open xibre opened this issue 8 years ago • 2 comments

Hello. First of all, thanks for the library.

I am writing an application in TypeScript and I am unable to compile it when using the current version of argon2 (v0.17.1). In particular, the following line fails to compile:

let hash: string = await argon2.hash('mypassword');

The compiler says: Type 'Buffer' is not assignable to type 'string'., but it clearly should resolve with a string in this case.

Downgrading to v0.16.2 helped, so I suspect the problem is somewhere in this patch: https://github.com/ranisalt/node-argon2/commit/dcc402f83195d4c58bd807112f93914a79c70a84.

xibre avatar Jan 31 '18 16:01 xibre

Maybe @felipeochoa himself can help.

I am currently refactoring to return a Hash object that should ease this issue and verifying.

ranisalt avatar Jan 31 '18 18:01 ranisalt

@ranisalt @felipeochoa Thanks a lot!

xibre avatar Jan 31 '18 20:01 xibre