keeweb/kdbxweb

Incorrect Argon documentation?

Closed this issue · 1 comments

The readme says this:

// your implementation makes hash (Uint32Array, 'length' bytes)

so I did this:

const result: Argon2BrowserHashResult = await argon.hash({
        pass: new Uint8Array(password),
        salt: new Uint8Array(salt),
        time: iterations,
        mem: memory,
        parallelism: parallelism,
        hashLen: length,
        type: type,
});

// your implementation makes hash (Uint32Array, 'length' bytes)
return new Uint32Array(result.hash.buffer);

(Note the new UInt32Array)
This resulted in a failure to decrypt. When I simply returned the Uint8Array in result.hash, everything was fine.

Is the doc wrong or did I misunderstand?

Thanks! That's a typo indeed.