https://github.com/murphsicles/varint
@serde/varint — unsigned LEB128 variable integer encoding for Zeta
https://github.com/murphsicles/varint
Last synced: 22 days ago
JSON representation
@serde/varint — unsigned LEB128 variable integer encoding for Zeta
- Host: GitHub
- URL: https://github.com/murphsicles/varint
- Owner: murphsicles
- License: mit
- Created: 2026-06-07T01:26:56.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2026-06-07T02:38:41.000Z (about 2 months ago)
- Last Synced: 2026-06-07T03:40:51.710Z (about 2 months ago)
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# varint — Variable-length integer encoding for Zeta
**Namespace:** `@serde/varint`
Unsigned LEB128 variable-length integer encoding and decoding.
## Usage
```zeta
use serde::varint::{encode, decode};
// Encode a u64 into a varint byte buffer
let buf: [i64; 10] = [0; 10];
let count: i64 = encode_u64(300, buf);
// Decode a varint from a byte buffer
let (value, consumed): (i64, i64) = decode_u64(buf, 0);
```
## API
- `encode_u64(value, buf)` — encode a u64, returns bytes written
- `decode_u64(buf, index)` — decode a u64, returns (value, bytes consumed)
## Implementation
Transpiled from `unsigned-varint` v0.8.0 via dark-factory Rust-to-Zeta transpiler.
## License
MIT — The Zeta Foundation