mirror of
https://github.com/fluencelabs/js-libp2p-crypto
synced 2025-03-15 21:30:59 +00:00
`bn.toArrayLike` is used instead of `bn.toBuffer`, to ensure compatibility with browserify.
22 lines
391 B
JavaScript
22 lines
391 B
JavaScript
/* eslint max-nested-callbacks: ["error", 8] */
|
|
/* eslint-env mocha */
|
|
'use strict'
|
|
|
|
const expect = require('chai').expect
|
|
const util = require('../src/crypto/util')
|
|
const BN = require('bn.js')
|
|
|
|
describe('Util', () => {
|
|
let bn
|
|
|
|
before((done) => {
|
|
bn = new BN('dead', 16)
|
|
done()
|
|
})
|
|
|
|
it('toBase64', (done) => {
|
|
expect(util.toBase64(bn)).to.be.eql('3q0')
|
|
done()
|
|
})
|
|
})
|