Thanks again @antelle for all your hard work! I noticed two issues trying out the verify functionality and the solutions aren't immediately apparent to me or I'd submit a PR.
Argon2 type should be determined from encoded string when available, I think. I'm not sure what's going on in the lines above where the params are being encoded, but it doesn't seem to cover getting the Argon2 type. Without passing the type manually you'll get: Uncaught (in promise) {message: "Decoding failed", code: -32}
Is the best way to correct this to simply search the front of the string for the type identifier? (argon2i, argon2d, argon2id)
Hm, good question, I don't know why it's implemented this way in the library. I've changed the js, so that it reads types from params.encoded, unless it's specified explicitly.
Thanks again @antelle for all your hard work! I noticed two issues trying out the
verify
functionality and the solutions aren't immediately apparent to me or I'd submit a PR.params
are being encoded, but it doesn't seem to cover getting the Argon2 type. Without passing the type manually you'll get:Uncaught (in promise) {message: "Decoding failed", code: -32}
Is the best way to correct this to simply search the front of the string for the type identifier? (argon2i, argon2d, argon2id)
2. When I do pass atype
into the params forverify
I getundefined
as the result. The point where things seem to be going awry as best as I can tell is here, where nothing is being returned https://github.com/antelle/argon2-browser/blob/master/lib/argon2.js#L155Not sure what I did wrong the first time, but this definitely works now.