Node-இன் built-in crypto module cryptographic functions-ஐ வழங்குகிறது: hashing, encryption, random values, மற்றும் HMAC. மிக முக்கியமான நடைமுறை பயன்பாடு — password hashing — ஒரு முக்கியமான விதியைக் கொண்டுள்ளது: passwords-க்கு வேகமான, பொது-நோக்க hashes-ஐ (MD5/SHA-256) ஒருபோதும் பயன்படுத்தாதீர்கள்.
Password hashing: ஒரு SLOW, salted algorithm-ஐப் பயன்படுத்தவும்
{ scrypt, randomBytes, timingSafeEqual } ;
{ promisify } ;
scryptAsync = (scrypt);
() {
salt = ().();
derived = (password, salt, );
;
}
() {
[salt, hash] = stored.();
derived = (password, salt, );
hashBuf = .(hash, );
(hashBuf, derived);
}
