39 releases (18 breaking)

new 0.19.0-rc.1 Mar 5, 2026
0.18.0-rc.4 Jan 26, 2026
0.17.0-rc.6 Dec 10, 2025
0.17.0-rc.2 Nov 25, 2025
0.3.0 Oct 13, 2019

#518 in Encoding


Used in 2 crates

MIT license

130KB
3K SLoC

enc

This library aids in processing encoded data.

Features & Dependencies

enc = { version = "0.19.0-rc.1", features = ["full"] }

Primary Features

full
base-64           
hex
percent
var-int

For more features see the Crate Docs.

Dependencies

This crate has no dependencies.

Data & Value Encoding

There are separate traits for handling encoded data and encoded values.

The src/data folder holds the traits: Encoder, StringEncoder, Decoder and Validator. These traits provide an interface for encoders that operate on byte slices, such as base-64 & hex.

The src/value folder holds the traits: EncodedLen, EncodeToSlice, EncodeToWrite etc. These traits provide an interface for values that know how to encode and decode themselves such as var-int.

Future Work

  • Write better test cases and add fuzz testing.
  • Optimize encoding & decoding performance & memory usage.
  • Add third-party crate support for encodings (ex: faster-hex).
  • Add support for serde.
  • Add support for async contexts.
  • Add support for no-std contexts.
  • Review unsafe code.

Dependencies