KokaKiwi / rust-hex

A basic crate to encode values to hexadecimal representation. Originally extracted from rustc-serialize.
https://crates.io/crates/hex
Apache License 2.0
203 stars 57 forks source link

feat: no-allocation hex-encoding using `HexWriter` #86

Closed elsirion closed 4 days ago

elsirion commented 8 months ago

HexWriter allows to directly hex-encode binary data to a std::fmt::Write object from any source that can write to a std::io::Write object. This saves between one and two allocations depending on the use case.

Let's assume a function Foo::encode(&self, writer: std::io::Write) -> Result<(), std::io::Error>:

elsirion commented 8 months ago

@dpc this project might be unmaintained, should we just publish a fork?

dpc commented 8 months ago

@elsirion Rust Bitcoin has a separate hex crate now or something. Maybe we can just add it there. Maintaining creates is a lot of ungrateful work. 🤣