mirror of
https://github.com/katanemo/plano.git
synced 2026-06-29 15:49:40 +02:00
16 lines
398 B
TypeScript
16 lines
398 B
TypeScript
import { generateId } from "ai";
|
|
import { genSaltSync, hashSync } from "bcrypt-ts";
|
|
|
|
export function generateHashedPassword(password: string) {
|
|
const salt = genSaltSync(10);
|
|
const hash = hashSync(password, salt);
|
|
|
|
return hash;
|
|
}
|
|
|
|
export function generateDummyPassword() {
|
|
const password = generateId();
|
|
const hashedPassword = generateHashedPassword(password);
|
|
|
|
return hashedPassword;
|
|
}
|