add keycrow feature ideas, exclude features/ from biome

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 17:03:13 +01:00
parent 1b5cff78e2
commit f29332f3dd
19 changed files with 6959 additions and 1 deletions
+33
View File
@@ -0,0 +1,33 @@
import CryptoJS from 'crypto-js';
import { config } from '../config';
export class EncryptionService {
private static instance: EncryptionService;
private readonly key: string;
private constructor() {
this.key = config.encryption.key;
}
static getInstance(): EncryptionService {
if (!EncryptionService.instance) {
EncryptionService.instance = new EncryptionService();
}
return EncryptionService.instance;
}
encrypt(plainText: string): string {
return CryptoJS.AES.encrypt(plainText, this.key).toString();
}
decrypt(cipherText: string): string {
const bytes = CryptoJS.AES.decrypt(cipherText, this.key);
return bytes.toString(CryptoJS.enc.Utf8);
}
hash(data: string): string {
return CryptoJS.SHA256(data).toString();
}
}
export const encryptionService = EncryptionService.getInstance();