DeveloperBreeze

Sha-256 Development Tutorials, Guides & Insights

Unlock 1+ expert-curated sha-256 tutorials, real-world code snippets, and modern dev strategies. From fundamentals to advanced topics, boost your sha-256 skills on DeveloperBreeze.

Hashing Password with SHA-256 using 'crypto' module

Code January 26, 2024
javascript

// Import 'crypto' module
const crypto = require('crypto');

// Example password
const password = 'mypassword';

// Create SHA-256 hash of the password
const hash = crypto.createHash('sha256').update(password).digest('hex');

// Log the generated hash
console.log('Hash:', hash);