mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-17 18:21:10 +10:00
initial commit
This commit is contained in:
11
server/internal/security/simple.ts
Normal file
11
server/internal/security/simple.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import bcrypt from 'bcrypt';
|
||||
|
||||
const rounds = 10;
|
||||
|
||||
export async function createHash(password: string) {
|
||||
return bcrypt.hashSync(password, rounds);
|
||||
}
|
||||
|
||||
export async function checkHash(password: string, hash: string) {
|
||||
return bcrypt.compareSync(password, hash);
|
||||
}
|
||||
Reference in New Issue
Block a user