{"id":16957270,"url":"https://github.com/ahamez/varint","last_synced_at":"2025-04-12T16:37:24.103Z","repository":{"id":14178558,"uuid":"76118919","full_name":"ahamez/varint","owner":"ahamez","description":"An Elixir library to compress integers using the Variable Length Encoding LEB128 compression.","archived":false,"fork":false,"pushed_at":"2025-03-31T06:08:48.000Z","size":124,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T13:30:18.278Z","etag":null,"topics":["compress-integers","elixir","varint"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahamez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["ahamez"]}},"created_at":"2016-12-10T14:54:03.000Z","updated_at":"2025-04-09T13:32:07.000Z","dependencies_parsed_at":"2024-01-12T11:50:23.774Z","dependency_job_id":"31976263-2ebd-45e1-88c6-08a410ecccd0","html_url":"https://github.com/ahamez/varint","commit_stats":{"total_commits":152,"total_committers":6,"mean_commits":"25.333333333333332","dds":0.375,"last_synced_commit":"1c37a31f531c2f9df39332f9f59fab92ca3b73ae"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahamez%2Fvarint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahamez%2Fvarint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahamez%2Fvarint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahamez%2Fvarint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahamez","download_url":"https://codeload.github.com/ahamez/varint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248597597,"owners_count":21130904,"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":["compress-integers","elixir","varint"],"created_at":"2024-10-13T22:18:37.015Z","updated_at":"2025-04-12T16:37:24.080Z","avatar_url":"https://github.com/ahamez.png","language":"Elixir","funding_links":["https://github.com/sponsors/ahamez"],"categories":[],"sub_categories":[],"readme":"# Varint\n\n[![Elixir CI](https://github.com/ahamez/varint/actions/workflows/elixir.yml/badge.svg)](https://github.com/ahamez/varint/actions/workflows/elixir.yml) [![Coverage Status](https://coveralls.io/repos/github/ahamez/varint/badge.svg?branch=master)](https://coveralls.io/github/ahamez/varint?branch=master) [![Hex.pm](https://img.shields.io/hexpm/v/varint)](https://hex.pm/packages/varint) [![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/varint/) [![License](https://img.shields.io/hexpm/l/varint.svg)](https://github.com/ahamez/varint/blob/master/LICENSE)\n\nA library to compress integers using [LEB128](https://en.wikipedia.org/wiki/LEB128).\n\n## Installation\n\nAdd `:varint` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:varint, \"~\u003e 1.4\"}]\nend\n```\n\n## Usage\n\n### LEB128\n\nUse this module to compress and decompress unsigned integers:\n\n```elixir\niex\u003e Varint.LEB128.encode(300)\n\u003c\u003c172, 2\u003e\u003e\n```\n\n```elixir\niex\u003e Varint.LEB128.decode(\u003c\u003c172, 2\u003e\u003e)\n{300, \u003c\u003c\u003e\u003e}\n```\n\n### Zigzag\n\nAs LEB128 works with unsigned integers, you can use the the Zigzag module to process signed integers.\n\n```elixir\niex\u003e Varint.Zigzag.encode(-2)\n3\n```\n\n```elixir\niex\u003e Varint.Zigzag.decode(3)\n-2\n```\n\n```elixir\niex\u003e Varint.Zigzag.encode(2)\n4\n```\n\n```elixir\niex\u003e Varint.Zigzag.decode(4)\n2\n```\n\nYou'll find detailed instructions at [hexdocs.pm](https://hexdocs.pm/varint/api-reference.html).\n\n## License\n\nCopyright (c) 2016 Alexandre Hamez\n\nThis work is free. You can redistribute it and/or modify it under the\nterms of the MIT License. See the LICENSE file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahamez%2Fvarint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahamez%2Fvarint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahamez%2Fvarint/lists"}