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
201 stars 55 forks source link

encode_to_slice with _upper and _lower variants #45

Open peku33 opened 4 years ago

peku33 commented 4 years ago

At the moment there is no way to choose between case mode when using allocation free encode_to_slice. Current behavior defaults to lowercase.

My proposal is to: change encode_to_slice -> encode_to_slice_lower addencode_to_slice_upper`

let (high, low) = byte2hex(*byte, HEX_CHARS_LOWER); HEX_CHARS_LOWER could be easily parametrized