-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Description
I'm new to javascript so excuse me if this is trivial, it took me a while to figure it out so i think it should be good to include this in the example to save people some time.
To save the hash to db i need to convert it first to a string.
When a user logs in i need to create a new buffer with the saved hash in order to use the verify function.
Using Buffer.from returns the error
"Error: hashBuf must be HASH_BYTES (128)"
Because the buffer length is 96.
It should be something:
const savedHash = Buffer.alloc(securePassword.HASH_BYTES)
savedHash.write(dbhashedvalue)
Also from what i understand it's not possible to set the value of securePassword.HASH_BYTES right?
Thank you
Metadata
Metadata
Assignees
Labels
No labels