You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

varint

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

varint - npm Package Compare versions

Comparing version

to
3.0.1

2

package.json
{
"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