Sha256: 6e2b69ed27163c07c935f5ad0b722a9df44a47e4a2e13f5b43e43c99a56f9e88
Contents?: true
Size: 850 Bytes
Versions: 36
Compression:
Stored size: 850 Bytes
Contents
var test = require("tape") var crypto = require('crypto') var cryptoB = require('../') function assertSame (fn) { test(fn.name, function (t) { t.plan(1) fn(crypto, function (err, expected) { fn(cryptoB, function (err, actual) { t.equal(actual, expected) t.end() }) }) }) } assertSame(function sha1 (crypto, cb) { cb(null, crypto.createHash('sha1').update('hello', 'utf-8').digest('hex')) }) assertSame(function md5(crypto, cb) { cb(null, crypto.createHash('md5').update('hello', 'utf-8').digest('hex')) }) test('randomBytes', function (t) { t.plan(5) t.equal(cryptoB.randomBytes(10).length, 10) t.ok(cryptoB.randomBytes(10) instanceof Buffer) cryptoB.randomBytes(10, function(ex, bytes) { t.error(ex) t.equal(bytes.length, 10) t.ok(bytes instanceof Buffer) t.end() }) })
Version data entries
36 entries across 36 versions & 2 rubygems