Socket
Book a DemoInstallSign in
Socket

zigzag

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zigzag

zigzag signed integer encoding and decoding

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

zigzag

a module for zigzag encoding in JS.


var zz = require('zigzag')

zz.encode32(3)

zz.decode32(3)

zz.encode64high(lowint, highint)
zz.encode64low(lowint, highint)

API

zz.encode32(number) -> encoded integer

zz.encode64low(lowint, highint) -> encoded integer

zz.encode64high(lowint, highint) -> encoded integer

encodes an integer using zigzag encoding. for >32bit values, use encode64{low,high} to get the constituent int32 values.

zz.decode32(number) -> decoded integer

zz.decode64low(lowint, highint) -> decoded integer

zz.decode64high(lowint, highint) -> decoded integer

decodes a zigzag-encoded integer. for >32bit values, use decode64{low,high} to get the constituent int32 values.

license

MIT

Keywords

zigzag

FAQs

Package last updated on 04 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts