#varint #leb128 #protobuf

deprecated no-std const-varint

(Deprecated) This crate is deprecated. Please use varing instead.

9 unstable releases (3 breaking)

0.4.2+deprecated Mar 30, 2025
0.4.1+deprecated Mar 30, 2025
0.3.4 Mar 22, 2025
0.2.1 Feb 6, 2025
0.1.1 Feb 3, 2025

#17 in #leb128

Download history 376/week @ 2025-01-29 486/week @ 2025-02-05 1084/week @ 2025-02-12 1279/week @ 2025-02-19 1445/week @ 2025-02-26 534/week @ 2025-03-05 273/week @ 2025-03-12 972/week @ 2025-03-19 666/week @ 2025-03-26 336/week @ 2025-04-02 209/week @ 2025-04-09

2,195 downloads per month
Used in 16 crates (3 directly)

MIT/Apache

66KB
1.5K SLoC

Note: This crate is renamed to varing.

const-varint

Protobuf's varint encoding/decoding with full const context operations supports. (This project is renamed to varing)

github LoC Build codecov

docs.rs crates.io crates.io license

Installation

[dependencies]
const-varint = "0.4"
  • For u1, u2, u3, .., u127

    const-varint = { version = "0.4", features = "arbitrary-int" }
    
  • For ruint::Uint<BITS, LBITS> support (not compatible in const context)

    const-varint = { version = "0.4", features = ["ruint"] }
    
  • For primitive-types support (not compatible in const context)

    const-varint = { version = "0.4", features = ["primitive-types"] }
    
  • For ethereum-types support (not compatible in const context)

    const-varint = { version = "0.4", features = ["ethereum-types"] }
    

License

const-varint is under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, LICENSE-MIT for details.

Copyright (c) 2025 Al Liu.

Dependencies

~0.2–0.8MB
~19K SLoC