prorm API Reference
    Preparing search index...

    Interface AlgorithmOptions

    Options for ALGORITHM data type

    interface AlgorithmOptions {
        algorithm: HashAlgorithm;
        cost?: number;
        saltLength?: number;
        hashLength?: number;
        includeSalt?: boolean;
        parallelism?: number;
        blockSize?: number;
    }
    Index
    algorithm: HashAlgorithm

    The hash algorithm to use Supported algorithms:

    • BCRYPT: Blowfish-based bcrypt (default cost 10)
    • MD5: Message Digest 5 (128-bit hash, 32 hex chars)
    • SHA1: Secure Hash Algorithm 1 (160-bit hash, 40 hex chars)
    • SHA256: SHA-2 256-bit (64 hex chars)
    • SHA384: SHA-2 384-bit (96 hex chars)
    • SHA512: SHA-2 512-bit (128 hex chars)
    • SHA512_256: SHA-2 512/256-bit (64 hex chars)
    • ARGON2: Argon2 password hashing (winner of PHC)
    • PBKDF2: Password-Based Key Derivation Function 2
    • SCRYPT: Memory-hard hash function
    • NTLM: Windows NT LAN Manager hash
    • MYSQL: MySQL password hash
    • POSTGRESQL_MD5: PostgreSQL MD5 hash
    cost?: number

    Cost factor for the algorithm (for BCRYPT, ARGON2, PBKDF2, SCRYPT)

    • BCRYPT: Number of rounds (default 10, range 4-31)
    • ARGON2: Memory cost in KB (default 65536)
    • PBKDF2: Number of iterations (default 100000)
    • SCRYPT: Memory/cost parameter (default 16384)
    saltLength?: number

    Salt length in bytes (for algorithms that support it)

    hashLength?: number

    Hash length in bytes (for algorithms that support it)

    includeSalt?: boolean

    Whether to include the salt in the output (for BCRYPT, ARGON2) Default: true (includes salt in hash string)

    parallelism?: number

    Parallelism parameter (for ARGON2) Default: 1

    blockSize?: number

    Block size parameter (for ARGON2) Default: 8