Sha256: f03da9c2e37d5ae9ff928ec6f8820fc9eba1ca338d22391d3a519d675b80a349

Contents?: true

Size: 373 Bytes

Versions: 14

Compression:

Stored size: 373 Bytes

Contents

var createHash = require('create-hash');
module.exports = function (seed, len) {
  var t = new Buffer('');
  var  i = 0, c;
  while (t.length < len) {
    c = i2ops(i++);
    t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()]);
  }
  return t.slice(0, len);
};

function i2ops(c) {
  var out = new Buffer(4);
  out.writeUInt32BE(c,0);
  return out;
}

Version data entries

14 entries across 14 versions & 7 rubygems

Version Path
optimacms-0.4.3 spec/dummy/node_modules/public-encrypt/mgf.js
optimacms-0.4.2 spec/dummy/node_modules/public-encrypt/mgf.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/public-encrypt/mgf.js
locomotivecms-3.4.0 app/javascript/node_modules/public-encrypt/mgf.js
cortex-0.1.3 spec/dummy/node_modules/public-encrypt/mgf.js
dragonfly_puppeteer-0.1.0 node_modules/public-encrypt/mgf.js
lanes-0.8.0 node_modules/public-encrypt/mgf.js
minimum_viable_product-0.0.11 test/dummy/node_modules/public-encrypt/mgf.js
brwy_rails-0.0.6 test/dummy/node_modules/public-encrypt/mgf.js
brwy_rails-0.0.5 test/dummy/node_modules/public-encrypt/mgf.js
brwy_rails-0.0.4 test/dummy/node_modules/public-encrypt/mgf.js
brwy_rails-0.0.3 test/dummy/node_modules/public-encrypt/mgf.js
brwy_rails-0.0.2 test/dummy/node_modules/public-encrypt/mgf.js
brwy_rails-0.0.1 test/dummy/node_modules/public-encrypt/mgf.js