{"id":13822397,"url":"https://github.com/dermesser/integer-encoding-rs","last_synced_at":"2026-03-16T16:40:35.057Z","repository":{"id":38238629,"uuid":"60470073","full_name":"dermesser/integer-encoding-rs","owner":"dermesser","description":"Integer encoding for primitive integer types: Supports varint/varint+zigzag and fixed-length integer encoding and decoding, and provides synchronous and asynchronous Write/Read types for easily writing/reading integers.","archived":false,"fork":false,"pushed_at":"2024-08-01T15:30:45.000Z","size":715,"stargazers_count":67,"open_issues_count":5,"forks_count":15,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-03T07:37:02.575Z","etag":null,"topics":["encoding","endian","endianness","rust","varint"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dermesser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-05T16:38:15.000Z","updated_at":"2025-02-11T02:27:50.000Z","dependencies_parsed_at":"2024-06-18T21:24:15.694Z","dependency_job_id":"326d0a10-220e-4a0c-b87f-fb294af7d3f5","html_url":"https://github.com/dermesser/integer-encoding-rs","commit_stats":{"total_commits":150,"total_committers":11,"mean_commits":"13.636363636363637","dds":0.2733333333333333,"last_synced_commit":"5ef95f8d136e7c9ba0b9961861121761c502989f"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dermesser%2Finteger-encoding-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dermesser%2Finteger-encoding-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dermesser%2Finteger-encoding-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dermesser%2Finteger-encoding-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dermesser","download_url":"https://codeload.github.com/dermesser/integer-encoding-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076856,"owners_count":22010614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["encoding","endian","endianness","rust","varint"],"created_at":"2024-08-04T08:01:58.800Z","updated_at":"2025-12-30T03:01:12.540Z","avatar_url":"https://github.com/dermesser.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# integer-encoding-rs\n\n[![GitHub repo](https://img.shields.io/badge/github-dermesser/integer--encoding-8da0cb?logo=github)](https://github.com/dermesser/integer-encoding-rs)\n[![crates.io version](https://img.shields.io/crates/v/integer-encoding)](https://crates.io/crates/integer-encoding)\n[![crate usage](https://img.shields.io/crates/d/integer-encoding)](https://crates.io/crates/integer-encoding)\n[![docs.rs status](https://img.shields.io/docsrs/integer-encoding)](https://docs.rs/integer-encoding)\n[![crates.io license](https://img.shields.io/crates/l/integer-encoding)](https://github.com/dermesser/integer-encoding-rs/blob/main/LICENSE)\n[![CI build status](https://github.com/dermesser/integer-encoding-rs/actions/workflows/test.yml/badge.svg)](https://github.com/dermesser/integer-encoding-rs/actions)\n\n[full documentation](https://docs.rs/integer-encoding/)\n\nThis crate provides encoding and decoding of integers to and from bytestring\nrepresentations.\n\nThe format is described here: [Google's protobuf integer encoding technique](https://developers.google.com/protocol-buffers/docs/encoding).\n\nPlease feel free to use `cargo bench` to determine the rate at which your\nmachine can encode and decode varints and fixedints. Note that one iteration\ncomprises each eight rounds of encoding (or decoding) a signed and an unsigned\ninteger each -- divide the resulting benchmark time by 16 in order to have a\nrough estimate of time per operation. The integers are very large, so the\nresults represent the worst case.\n\n## Crate\n\nIf you use Tokio v0.2 and you use the asynchronous types in this crate (feature\n`tokio_async`), you may be interested in the `v2.0` branch. It is still\nmaintained with the occasional fix for edge cases and depends on Tokio v0.2.\n\n## FixedInt\n\n`FixedInt` casts integers to bytes by either copying the underlying memory or\nperforming a transmutation. The encoded values use are little-endian.\n\nHowever, a trait method is implemented for all integer types allowing convenient conversion between\nlittle and big endian. That is, if you receive a big-endian on the wire and decode it, it will first\nbe interpreted as little-endian; converting will recover the correct value.\n\n## VarInt\n\n`VarInt` encodes integers in blocks of 7 bits; the MSB is set for every byte but\nthe last, in which it is cleared.\n\nSigned values are first converted to an unsigned representation using zigzag\nencoding (also described on the page linked above), and then encoded as every\nother unsigned number.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdermesser%2Finteger-encoding-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdermesser%2Finteger-encoding-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdermesser%2Finteger-encoding-rs/lists"}