Tabnine Logo For Javascript
createHash
Code IndexAdd Tabnine to your IDE (free)

How to use
createHash
function
in
crypto

Best JavaScript code snippets using crypto.createHash(Showing top 15 results out of 2,538)

origin: clinicjs/node-clinic

function hash (filename, cb) {
 const sha = crypto.createHash('sha512')
 sha.update('clinic\n')
 fs.createReadStream(filename)
  .on('data', data => sha.update(data))
  .on('end', () => cb(null, sha.digest()))
  .on('error', cb)
}
origin: parse-community/parse-server

constructor(mongoDatabaseURI = _defaults.default.DefaultMongoURI, mongoOptions = {}, fileKey = undefined) {
  super();
  this._databaseURI = mongoDatabaseURI;
  this._algorithm = 'aes-256-gcm';
  this._fileKey = fileKey !== undefined ? crypto.createHash('sha256').update(String(fileKey)).digest('base64').substr(0, 32) : null;
  const defaultMongoOptions = {
   useNewUrlParser: true,
   useUnifiedTopology: true
  };
  this._mongoOptions = Object.assign(defaultMongoOptions, mongoOptions);
 }
origin: shen100/mili

private encryptPassword(password, salt, configSalt) {
    const m1 = crypto.createHash('md5');
    const pass = m1.update(password).digest('hex');
    let hash = salt + pass + configSalt;
    const m2 = crypto.createHash('md5');
    hash = salt + m2.update(hash).digest('hex');
    return hash;
  }
origin: remoteinterview/zero

function sha1(data) {
 return crypto
  .createHash("sha1")
  .update(data, "binary")
  .digest("hex");
}
origin: cube-js/cube.js

fileHash(file) {
  return new Promise((resolve, reject) => {
   const hash = crypto.createHash('sha1');
   const stream = fs.createReadStream(file);
   stream.on('error', err => reject(err));
   stream.on('data', chunk => hash.update(chunk));
   stream.on('end', () => resolve(hash.digest('hex')));
  });
 }
origin: moleculerjs/moleculer

_hashedKey(key) {
    const maxParamsLength = this.opts.maxParamsLength;
    if (!maxParamsLength || maxParamsLength < 44 || key.length <= maxParamsLength)
      return key;

    const prefixLength = maxParamsLength - 44;

    const base64Hash = crypto.createHash("sha256").update(key).digest("base64");
    if (prefixLength < 1)
      return base64Hash;

    return key.substring(0, prefixLength) + base64Hash;
  }
origin: remoteinterview/zero

const sha1 = path =>
 new Promise((resolve, reject) => {
  const hash = crypto.createHash("sha1");
  const rs = fs.createReadStream(path);
  rs.on("error", reject);
  rs.on("data", chunk => hash.update(chunk));
  rs.on("end", () => resolve(hash.digest("hex")));
 })
origin: shen100/mili

const md5 = (data: string, inputEncoding, encoding) => {
  if (!data) {
    return '';
  }
  inputEncoding = inputEncoding || 'utf-8';
  encoding = encoding || 'hex';
  const hash = crypto.createHash('md5');
  return hash.update(data, inputEncoding).digest(encoding);
}
origin: tulios/kafkajs

/**
  * @private
  */
 H(data) {
  return crypto
   .createHash(this.digestDefinition.type)
   .update(data)
   .digest()
 }
origin: remoteinterview/zero

function sha1(data) {
 return crypto
  .createHash("sha1")
  .update(data, "binary")
  .digest("hex");
}
origin: remoteinterview/zero

function sha1(data) {
 return crypto
  .createHash("sha1")
  .update(data, "binary")
  .digest("hex");
}
origin: remoteinterview/zero

function sha1(data) {
 return crypto
  .createHash("sha1")
  .update(data, "binary")
  .digest("hex");
}
origin: moleculerjs/moleculer

function getSHA(fileName) {
  return new Promise((resolve, reject) => {
    let hash = crypto.createHash("sha1");
    let stream = fs.createReadStream(fileName);
    stream.on("error", err => reject(err));
    stream.on("data", chunk => hash.update(chunk));
    stream.on("end", () => resolve(hash.digest("hex")));
  });
}
origin: remoteinterview/zero

function sha1(data) {
 return crypto
  .createHash("sha1")
  .update(data, "binary")
  .digest("hex");
}
origin: shen100/mili

const sha1 = (data: string, inputEncoding, encoding) => {
  if (!data) {
    return '';
  }
  inputEncoding = inputEncoding || 'utf-8';
  encoding = encoding || 'hex';
  const hash = crypto.createHash('sha1');
  return hash.update(data, inputEncoding).digest(encoding);
}
cryptocreateHash

Most used crypto functions

  • Hash.update
  • Hash.digest
  • randomBytes
  • Hmac.digest
  • Hmac.update
  • Cipher.final,
  • Cipher.update,
  • Decipher.update,
  • Decipher.final,
  • createCipheriv,
  • createCipher,
  • createDecipheriv,
  • createDecipher,
  • pbkdf2,
  • publicEncrypt,
  • privateDecrypt,
  • pbkdf2Sync,
  • DecipherGCM.final

Popular in JavaScript

  • q
    A library for promises (CommonJS/Promises/A,B,D)
  • winston
    A logger for just about everything.
  • http
  • superagent
    elegant & feature rich browser / node HTTP with a fluent API
  • debug
    small debugging utility
  • handlebars
    Handlebars provides the power necessary to let you build semantic templates effectively with no frustration
  • cheerio
    Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
  • body-parser
    Node.js body parsing middleware
  • mocha
    simple, flexible, fun test framework
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now