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

Version Path
sumomo-0.10.8 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.10.4 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.10.3 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.10.2 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.10.1 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.10.0 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.9.0 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.8.22 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.8.21 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.8.20 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.8.17 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.8.16 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.8.15 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.8.14 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.8.13 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.8.12 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.8.11 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.8.10 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.8.9 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js
sumomo-0.8.8 data/sumomo/api_modules/node_modules/crypto-browserify/test/simple.js