Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tv42/varint
Variable integer encoding/decoding tools
https://github.com/tv42/varint
Last synced: 20 days ago
JSON representation
Variable integer encoding/decoding tools
- Host: GitHub
- URL: https://github.com/tv42/varint
- Owner: tv42
- License: mit
- Created: 2014-05-21T00:11:21.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-02-04T17:27:06.000Z (almost 4 years ago)
- Last Synced: 2024-10-16T02:07:23.086Z (2 months ago)
- Language: Go
- Size: 2.93 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# {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](https://developers.google.com/protocol-buffers/docs/overview)
and Go's [encoding/binary](http://golang.org/pkg/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:
``` console
$ 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
```