n8cn / packages /cli /src /services /password.utility.ts
gallyga's picture
Add n8n Chinese version
aec3094
import { Service as Utility } from '@n8n/di';
import { compare, hash } from 'bcryptjs';
const SALT_ROUNDS = 10;
@Utility()
export class PasswordUtility {
async hash(plaintext: string) {
return await hash(plaintext, SALT_ROUNDS);
}
async compare(plaintext: string, hashed: string) {
return await compare(plaintext, hashed);
}
}