Initial commit

This commit is contained in:
Lance
2026-01-16 15:33:40 +08:00
committed by GitHub
commit 037e36f4f4
67 changed files with 5589 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import bcrypt from "bcrypt";
import { uuidv7 } from "uuidv7";
import type { ICryptoService } from "@/shared/application/ports/ICryptoService.js";
export class BcryptService implements ICryptoService {
hashPassword(password: string): Promise<string> {
return bcrypt.hash(password, 10);
}
comparePassword(password: string, hash: string): Promise<boolean> {
return bcrypt.compare(password, hash);
}
randomId(): string {
return uuidv7();
}
}