Skip to content

Instantly share code, notes, and snippets.

@umidjons
Created January 18, 2017 11:50
Show Gist options
  • Save umidjons/5e22bdb6b7683c6931598bf5aa4d043e to your computer and use it in GitHub Desktop.
Save umidjons/5e22bdb6b7683c6931598bf5aa4d043e to your computer and use it in GitHub Desktop.
Create sha1 hash

Create SHA1 hash

'use strict';

const crypto = require('crypto');
let hash = crypto.createHash('sha1').update('some data to hash').digest('hex');

console.log('hash:', hash);

Output:

hash: 3d22ca807ad75c9ff3ca07c4e6c396b7d99f7206
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment