mirror of
https://github.com/fluencelabs/js-libp2p-crypto
synced 2025-03-15 19:20:56 +00:00
26 lines
470 B
JavaScript
26 lines
470 B
JavaScript
/* eslint max-nested-callbacks: ["error", 8] */
|
|
/* eslint-env mocha */
|
|
'use strict'
|
|
|
|
const chai = require('chai')
|
|
const dirtyChai = require('dirty-chai')
|
|
const expect = chai.expect
|
|
chai.use(dirtyChai)
|
|
|
|
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()
|
|
})
|
|
})
|