Comparing version 1.1.1 to 1.1.2
@@ -7,12 +7,12 @@ function byteLength (string) { | ||
const len = buffer.byteLength | ||
const len32 = len >>> 2 | ||
const buffer32 = new Uint32Array(buffer.buffer, buffer.byteOffset, len32) | ||
const view = new DataView(buffer.buffer, buffer.byteOffset, len) | ||
let result = '' | ||
let i = 0 | ||
for (let i = 0; i < len32; i++) { | ||
result += buffer32[i].toString(16).padStart(8, '0') | ||
for (let n = len - (len % 4); i < n; i += 4) { | ||
result += view.getUint32(i).toString(16).padStart(8, '0') | ||
} | ||
for (let i = len32 << 2; i < len; i++) { | ||
for (; i < len; i++) { | ||
result += buffer[i].toString(16).padStart(2, '0') | ||
@@ -19,0 +19,0 @@ } |
{ | ||
"name": "b4a", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Bridging the gap between buffers and typed arrays", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20747