boredgame/src/lib/server/api/common/services/hashing.service.ts
2024-12-01 15:34:04 -08:00

13 lines
303 B
TypeScript

import { injectable } from '@needle-di/core';
import { hash, verify } from 'argon2';
@injectable()
export class HashingService {
hash(data: string): Promise<string> {
return hash(data);
}
compare(data: string, encrypted: string): Promise<boolean> {
return verify(encrypted, data);
}
}