@webassemblyjs/leb128
Advanced tools
Comparing version 1.11.6 to 1.12.0
@@ -101,3 +101,3 @@ "use strict"; | ||
} else { | ||
result = new Buffer(length); | ||
result = new Uint8Array(length); | ||
} | ||
@@ -134,3 +134,7 @@ | ||
var newBuf = alloc(length); | ||
buffer.copy(newBuf); | ||
for (var i = 0; i <= buffer.length; i++) { | ||
newBuf[i] = buffer[i]; | ||
} | ||
free(buffer); | ||
@@ -236,4 +240,10 @@ return newBuf; | ||
var highWord = Math.floor(value / BIT_32); | ||
buffer.writeUInt32LE(lowWord, 0); | ||
buffer.writeUInt32LE(highWord, 4); | ||
buffer[0] = lowWord & 0xff; | ||
buffer[1] = lowWord >> 8 & 0xff; | ||
buffer[2] = lowWord >> 16 & 0xff; | ||
buffer[3] = lowWord >> 24 & 0xff; | ||
buffer[4] = highWord & 0xff; | ||
buffer[5] = highWord >> 8 & 0xff; | ||
buffer[6] = highWord >> 16 & 0xff; | ||
buffer[7] = highWord >> 24 & 0xff; | ||
} |
@@ -225,6 +225,8 @@ // Copyright 2012 The Obvious Corporation. | ||
function encodeInt32(num) { | ||
var buf = bufs.alloc(4); | ||
buf.writeInt32LE(num, 0); | ||
var buf = new Uint8Array(4); | ||
buf[0] = num & 0xff; | ||
buf[1] = num >> 8 & 0xff; | ||
buf[2] = num >> 16 & 0xff; | ||
buf[3] = num >> 24 & 0xff; | ||
var result = encodeIntBuffer(buf); | ||
bufs.free(buf); | ||
return result; | ||
@@ -286,6 +288,8 @@ } | ||
function encodeUInt32(num) { | ||
var buf = bufs.alloc(4); | ||
buf.writeUInt32LE(num, 0); | ||
var buf = new Uint8Array(4); | ||
buf[0] = num & 0xff; | ||
buf[1] = num >> 8 & 0xff; | ||
buf[2] = num >> 16 & 0xff; | ||
buf[3] = num >> 24 & 0xff; | ||
var result = encodeUIntBuffer(buf); | ||
bufs.free(buf); | ||
return result; | ||
@@ -292,0 +296,0 @@ } |
{ | ||
"name": "@webassemblyjs/leb128", | ||
"version": "1.11.6", | ||
"version": "1.12.0", | ||
"description": "LEB128 decoder and encoder", | ||
@@ -21,3 +21,4 @@ "license": "Apache-2.0", | ||
"access": "public" | ||
} | ||
}, | ||
"gitHead": "6d1606bde5ab7ef21ea4b25715bd2fe58e8742cd" | ||
} |
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
48526
10
1246