feat(README, filledDataView, sizedDataView)
This commit is contained in:
@ -1,19 +1,3 @@
|
||||
export function filledDataView(bytes) {
|
||||
const ab = new ArrayBuffer(bytes.length)
|
||||
const dv = new DataView(ab)
|
||||
|
||||
for (let i = 0; i < bytes.length; i++) {
|
||||
dv.setInt8(i, bytes[i])
|
||||
}
|
||||
|
||||
return dv
|
||||
}
|
||||
|
||||
export function sizedDataView(length) {
|
||||
const ab = new ArrayBuffer(length)
|
||||
return new DataView(ab)
|
||||
}
|
||||
|
||||
export function expectDataViewEqual(actual, expected) {
|
||||
const actualBytes = new Uint8Array(actual.buffer, actual.byteOffset, actual.byteLength)
|
||||
const expectedBytes = new Uint8Array(expected.buffer, expected.byteOffset, expected.byteLength)
|
||||
|
||||
Reference in New Issue
Block a user