fix: replace node buffers with uint8arrays (#180)

* fix: replace node buffers with uint8arrays

All usage of node buffers have been replaced with uint8arrays.

BREAKING CHANGES:

- Where node Buffers were returned, now Uint8Arrays are

* chore: remove commented code
This commit is contained in:
Alex Potsides
2020-08-07 15:23:02 +01:00
committed by GitHub
parent 8b3dc56dc2
commit a0f387aeab
35 changed files with 344 additions and 349 deletions

View File

@ -3,7 +3,6 @@
'use strict'
const chai = require('chai')
const { Buffer } = require('buffer')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
@ -32,8 +31,8 @@ describe('Util', () => {
expect(num.equals(bn)).to.be.true()
})
it('should convert base64url encoded string to Buffer with padding', () => {
it('should convert base64url encoded string to Uint8Array with padding', () => {
const buf = util.base64urlToBuffer('AP8', 2)
expect(Buffer.from([0, 255])).to.eql(buf)
expect(Uint8Array.from([0, 255])).to.eql(buf)
})
})