Skip to main content

hashHandler

function hashHandler(password: string)
async

Hashes a password using bcrypt.

Returns: Promise<string>

  • The hashed password.
    See the official bcrypt package documentation for more details:
PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
passwordstringThe plaintext password to hash.

See:

const hashedPassword = await hashHandler("mySecurePassword");
console.log(hashedPassword);