UNPKG

@kazion/create-app

Version:

A cli tool to help you get started with graphql and rest api's with typescript

15 lines (12 loc) 381 B
import bcrypt from 'bcrypt'; export async function hashPassword(password: string): Promise<string> { const hashedPassword = await bcrypt.hash(password, 10); return hashedPassword; } export async function comparePassword( password: string, hashedPassword: string, ): Promise<boolean> { const isValid = await bcrypt.compare(password, hashedPassword); return isValid; }