boredgame/src/lib/server/api/common/services/hashing.service.ts

14 lines
303 B
TypeScript
Raw Normal View History

2024-12-01 23:34:04 +00:00
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);
}
}