tibi-docs/docs/md/server-javascript-kontext/packages/bcrypt.md
2023-06-03 18:07:58 +00:00

511 B

bcrypt

interface BcryptPackage {
    /**
     * hash password via bcrypt algo
     *
     * @param password clear text password
     * @param options hashing options
     */
    hash(
        password: string,
        options?: {
            cost?: number
        }
    ): string

    /**
     * check password against hashed password via bcrypt algo
     *
     * @param password clear text password
     * @param hash hashed password
     */
    check(password: string, hash: string): boolean
}