prorm API Reference
    Preparing search index...

    Function createBcryptAdapter

    TypeScript Decorators / Annotations for ts-prorm-orm

    Exports all decorator utilities organized by category:

    Encryption —

    /

    for password hashing Procedures —

    /

    for stored procedures & SQL functions Views —

    for mapping a Model class to a database view Permissions —

    /

    /

    /

    /

    • Create a bcrypt adapter.

      Requires bcrypt or bcryptjs to be installed: npm install bcrypt (native, faster) npm install bcryptjs (pure JS, no native build)

      Parameters

      • bcryptLib: {
            hash(data: string, saltOrRounds: number): Promise<string>;
            compare(data: string, encrypted: string): Promise<boolean>;
        }
      • saltRounds: number = 12

        bcrypt cost factor (default: 12)

        Usage: import bcrypt from 'bcrypt'; setEncryptionAdapter(createBcryptAdapter(bcrypt, 12));

      Returns EncryptionAdapter