zigzag

0.0.3 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    12
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    12
  • 0.0.2
    5
  • 0.0.1
    6

Package Sidebar

Install

npm i zigzag

Weekly Downloads

11

Version

0.0.3

License

MIT

Last publish

Collaborators

  • chrisdickinson