fix: consistent buffer usage (#56)

* fix: consistent buffer usage

Closes #49

* more fixes for node 4
This commit is contained in:
Friedel Ziegelmayer
2017-01-16 05:17:50 +01:00
committed by David Dias
parent c45bdf602e
commit 1a2d468369
18 changed files with 65 additions and 42 deletions

View File

@ -97,14 +97,16 @@ describe('libp2p-crypto', () => {
true
)
})
})
it('randomBytes throws with no number passed', () => {
describe('randomBytes', () => {
it('throws with no number passed', () => {
expect(() => {
crypto.randomBytes()
}).to.throw
})
it('randomBytes', () => {
it('generates different random things', () => {
const buf1 = crypto.randomBytes(10)
expect(buf1.length).to.equal(10)
const buf2 = crypto.randomBytes(10)