Skip to content

encode_upper

Encodes bytes as uppercase hexadecimal.

use helpers4::hex::encode_upper;

Cargo feature hex (enabled by default). To compile only this module:

cargo add helpers4 --no-default-features --features hex

or in Cargo.toml:

[dependencies]
helpers4 = { version = "0.0.5", default-features = false, features = ["hex"] }
pub fn encode_upper(bytes: &[u8]) -> String
ParameterTypeDescription
bytes&[u8]The bytes to encode.

String

use helpers4::hex::encode_upper;

assert_eq!(encode_upper(&[0xde, 0xad, 0xbe, 0xef]), "DEADBEEF");

src/hex/encode_upper.rs