mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
* refactor: flatten infra folders * fix: database migrations * fix: test related import * fix: github actions workflow * chore: rename schemas to typesense-schemas
17 lines
447 B
TypeScript
17 lines
447 B
TypeScript
import { ICryptoRepository } from '@app/domain';
|
|
import { Injectable } from '@nestjs/common';
|
|
import { compareSync, hash } from 'bcrypt';
|
|
import { randomBytes, createHash } from 'crypto';
|
|
|
|
@Injectable()
|
|
export class CryptoRepository implements ICryptoRepository {
|
|
randomBytes = randomBytes;
|
|
|
|
hashBcrypt = hash;
|
|
compareBcrypt = compareSync;
|
|
|
|
hashSha256(value: string) {
|
|
return createHash('sha256').update(value).digest('base64');
|
|
}
|
|
}
|