prorm API Reference
    Preparing search index...

    Interface EncryptionAdapter

    Pluggable encryption adapter. Implement this interface to use any hashing library.

    interface EncryptionAdapter {
        hash(value: string): Promise<string>;
        verify(plain: string, hashed: string): Promise<boolean>;
    }
    Index
    • Hash a plain-text value.

      Parameters

      • value: string

        The plain-text string to hash

      Returns Promise<string>

      A promise that resolves to the hashed string

    • Verify a plain-text value against a previously computed hash.

      Parameters

      • plain: string

        The plain-text candidate

      • hashed: string

        The stored hash to compare against

      Returns Promise<boolean>

      A promise resolving to true if they match