Crypto SDK
    Preparing search index...

    Interface PasswordHashResult

    Result of a password hashing operation (Argon2).

    const { data } = await client.passwordHash({ password: 'hunter2' });
    const result: PasswordHashResult = data;
    console.log(result.phc); // PHC-format string
    console.log(result.hash, result.salt, result.params);
    interface PasswordHashResult {
        hash: string;
        salt: string;
        params: { t: number; m: number; p: number };
        algorithm: string;
        phc: string;
    }
    Index
    hash: string

    Hex-encoded password hash.

    salt: string

    Hex-encoded salt used for hashing.

    params: { t: number; m: number; p: number }

    Argon2 cost parameters (time, memory, parallelism).

    Type Declaration

    • t: number

      Time cost (iterations).

    • m: number

      Memory cost (KiB).

    • p: number

      Parallelism factor.

    algorithm: string

    Argon2 variant used (e.g. "argon2id").

    phc: string

    PHC-format encoded hash string.