signed-varint

WebJar for signed-varint

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

signed-varint
Last Version

Last Version

2.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

signed-varint
WebJar for signed-varint
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/dominictarr/signed-varint

Download signed-varint

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/signed-varint/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>signed-varint</artifactId>
    <version>2.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/signed-varint/
implementation 'org.webjars.npm:signed-varint:2.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/signed-varint/
implementation ("org.webjars.npm:signed-varint:2.0.1")
'org.webjars.npm:signed-varint:jar:2.0.1'
<dependency org="org.webjars.npm" name="signed-varint" rev="2.0.1">
  <artifact name="signed-varint" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='signed-varint', version='2.0.1')
)
libraryDependencies += "org.webjars.npm" % "signed-varint" % "2.0.1"
[org.webjars.npm/signed-varint "2.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : varint jar [5.0.0,5.1)

Project Modules

There are no modules declared in this project.

signed-varint

store signed integers efficiently, as per protocol-buffers.

For unsigned integers use varint.

Integers are mapped to positive integers, so that positive integers become positive even numbers (n2) and negative integers become positive odd numbers. (n-2 - 1)

This is the same as moving the sign bit from the most significant possition to the least significant. Otherwise, varint will encode negative numbers as large integers.

var varint = require('varint')
var svarint = require('signed-varint')

console.log('unsigned', varint.encode(-1))
console.log('signed', svarint.encode(-1))

//=> unsigned [255,255,255, 15]
//   signed [1]

License

MIT

Versions

Version
2.0.1