|
@ -11,8 +11,6 @@ function decode (buffer, maxLength, minimal) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var result |
|
|
|
|
|
|
|
|
|
|
|
// 40-bit
|
|
|
// 40-bit
|
|
|
if (length === 5) { |
|
|
if (length === 5) { |
|
|
var a = buffer.readUInt32LE(0) |
|
|
var a = buffer.readUInt32LE(0) |
|
@ -22,6 +20,8 @@ function decode (buffer, maxLength, minimal) { |
|
|
return b * 0x100000000 + a |
|
|
return b * 0x100000000 + a |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var result = 0 |
|
|
|
|
|
|
|
|
// 32-bit / 24-bit / 16-bit / 8-bit
|
|
|
// 32-bit / 24-bit / 16-bit / 8-bit
|
|
|
for (var i = 0; i < length; ++i) { |
|
|
for (var i = 0; i < length; ++i) { |
|
|
result |= buffer[i] << (8 * i) |
|
|
result |= buffer[i] << (8 * i) |
|
|