crypto
crypto makes hashes, random values and UUIDs. Use bcrypt or scrypt for passwords.
Example
const crypto = require("crypto");
console.log(crypto.createHash("sha256").update("abc").digest("hex").slice(0, 16));
console.log(crypto.randomBytes(4).length, crypto.randomUUID().length);
console.log(crypto.createHmac("sha256", "k").update("m").digest("hex").slice(0, 8));Result
ba7816bf8f01cfea 4 36 b60090e3
Exercise
Hash text.
crypto.createHash("")
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.