Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

prisma.ts

16 lines428 Bytes

1import crypto from 'node:crypto'
2import { PrismaClient } from '@prisma/client'
3​
4export const prismaClient = new PrismaClient()
5​
6export function hashPassword(password: string) {
7 return new Promise<string>((resolve, reject) => {
8 crypto.pbkdf2(password, 'salt', 100000, 64, 'sha256', (err, derivedKey) => {
9 if (err) {
10 reject(err)
11 } else {
12 resolve(derivedKey.toString('hex'))
13 }
14 })
15 })