Published on January 26, 2024By DeveloperBreeze

// 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);

Comments

Please log in to leave a comment.

Continue Reading:

Simple WebSocket Server using 'ws' library

Published on January 26, 2024

javascript

File Stream Copy using 'fs' module

Published on January 26, 2024

javascript

Execute Shell Command using 'child_process' module

Published on January 26, 2024

javascript

Parse URL and Query Parameters

Published on January 26, 2024

javascript

Create and Print Buffer

Published on January 26, 2024

javascript

Basic Authentication using 'express-basic-auth' middleware

Published on January 26, 2024

javascript

Construct File Path using 'path' module

Published on January 26, 2024

javascript

Event Emitter using 'events' module

Published on January 26, 2024

javascript

Set and Access Environment Variable

Published on January 26, 2024

javascript

Access Command-line Arguments

Published on January 26, 2024

javascript