🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

compact-encoding

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compact-encoding - npm Package Compare versions

Comparing version
3.2.0
to
3.3.0
+17
-3
index.js

@@ -174,3 +174,5 @@ const b4a = require('b4a')

if (state.end - state.start < 7) throw new Error('Out of bounds')
return uint24.decode(state) + 0x1000000 * uint32.decode(state)
return validateSafeUint(
uint24.decode(state) + 0x1000000 * uint32.decode(state)
)
}

@@ -191,3 +193,5 @@ })

if (state.end - state.start < 8) throw new Error('Out of bounds')
return uint32.decode(state) + 0x100000000 * uint32.decode(state)
return validateSafeUint(
uint32.decode(state) + 0x100000000 * uint32.decode(state)
)
}

@@ -208,3 +212,5 @@ })

if (state.end - state.start < 8) throw new Error('Out of bounds')
return 0x100000000 * uint32be.decode(state) + uint32be.decode(state)
return validateSafeUint(
0x100000000 * uint32be.decode(state) + uint32be.decode(state)
)
}

@@ -1091,2 +1097,10 @@ }

function validateSafeUint(n) {
if (n > Number.MAX_SAFE_INTEGER)
throw new Error(
'uint is greater than the maximum safe integer, use biguint/bigint'
)
return n
}
function validateUint(n) {

@@ -1093,0 +1107,0 @@ if (n >= 0 === false /* Handles NaN as well */)

+1
-1
{
"name": "compact-encoding",
"version": "3.2.0",
"version": "3.3.0",
"description": "A series of compact encoding schemes for building small and fast parsers and serializers",

@@ -5,0 +5,0 @@ "main": "index.js",