Instant mock of hashPassword that returns a deterministic result without performing any real Argon2 computation.
hashPassword
The "hash" is simply the SHA-256-style hex of the password XOR'd with a fixed salt, suitable for testing control flow only.
import { mockHashPassword } from "@sebastienrousseau/crypto-testing";const result = mockHashPassword("my-password");console.log(result.hash); // deterministic hex stringconsole.log(result.phc); // PHC-format string Copy
import { mockHashPassword } from "@sebastienrousseau/crypto-testing";const result = mockHashPassword("my-password");console.log(result.hash); // deterministic hex stringconsole.log(result.phc); // PHC-format string
Instant mock of
hashPasswordthat returns a deterministic result without performing any real Argon2 computation.The "hash" is simply the SHA-256-style hex of the password XOR'd with a fixed salt, suitable for testing control flow only.