diff --git a/.gitignore b/.gitignore index 7869968..97a81d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *~ node_modules +package-lock.json coverage doc playground diff --git a/utf32.js b/utf32.js index 0843b03..3110188 100644 --- a/utf32.js +++ b/utf32.js @@ -32,12 +32,12 @@ function decode(input, loose = false, format = 'uint32') { break case 'uint8-le': if (!(input instanceof Uint8Array)) throw new TypeError('Expected an Uint8Array') - if (input.byteLength % 4 !== 0) throw new TypeError('Expected even number of bytes') + if (input.byteLength % 4 !== 0) throw new TypeError('Expected length to be a multiple of 4') u32 = js.to32input(input, true) break case 'uint8-be': if (!(input instanceof Uint8Array)) throw new TypeError('Expected an Uint8Array') - if (input.byteLength % 4 !== 0) throw new TypeError('Expected even number of bytes') + if (input.byteLength % 4 !== 0) throw new TypeError('Expected length to be a multiple of 4') u32 = js.to32input(input, false) break default: