varint
Advanced tools
Comparing version 3.0.0 to 3.0.1
{ | ||
"name": "varint", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "protobuf-style varint bytes - use msb to create integer values of varying sizes", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -10,3 +10,3 @@ # varint | ||
varint.decode(bytes) // 300 | ||
varint.decode.bytesRead // 2 (the last decode() call required 2 bytes) | ||
varint.decode.bytes // 2 (the last decode() call required 2 bytes) | ||
``` | ||
@@ -18,7 +18,9 @@ | ||
### varint.encode(num[, output=[], offset=0]) -> array | ||
### varint.encode(num[, buffer=[], offset=0]) -> buffer | ||
encodes `num` into either the array given by `offset` or a new array at `offset` | ||
and returns that array filled with integers. | ||
Encodes `num` into `buffer` starting at `offset`. returns `buffer`, with the encoded varint written into it. If `buffer` is not provided, it will default to a new array. | ||
`varint.encode.bytes` will now be set to the number of bytes | ||
modified. | ||
### varint.decode(data[, offset=0]) -> number | ||
@@ -44,3 +46,3 @@ | ||
If varint is passed a buffer that does not contain a valid end | ||
byte, then `decode` will return undefined, and `decode.bytesRead` | ||
byte, then `decode` will return undefined, and `decode.bytes` | ||
will be set to 0. If you are reading from a streaming source, | ||
@@ -47,0 +49,0 @@ it's okay to pass an incomplete buffer into `decode`, detect this |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
8791
52
1