zigzag

zigzag signed integer encoding and decoding

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)
 

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

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

license

MIT