Skip to content

tv42/varint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

{u,}varint-{en,de}code -- Variable integer encoding/decoding tools

This repository provides command-line tools to interact with the varint/uvarint format, as used by Protocol Buffer and Go's encoding/binary package.

The {u,}varint-encode tools take integers on the command line and output binary. Use -- to pass negative integers.

The {u,}varint-decode tools read standard input and output integers, one per line.

Examples:

$ uvarint-encode 42 | hexdump -x
0000000    002a                                                        
0000001

$ varint-encode -- -42 | hexdump -x
0000000    0053                                                        
0000001

$ uvarint-encode 42 | uvarint-decode
42

$ varint-encode 42 | varint-decode
42

$ varint-encode -- -42 | varint-decode
-42

About

Variable integer encoding/decoding tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published