mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-01-10 11:15:49 +00:00
refactor(server)*: tsconfigs (#2689)
* refactor(server): tsconfigs * chore: dummy commit * fix: start.sh * chore: restore original entry scripts
This commit is contained in:
16
server/src/infra/repositories/crypto.repository.ts
Normal file
16
server/src/infra/repositories/crypto.repository.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user