use data_encoding::{HEXUPPER, DecodeError};
      
      fn main() -> Result<(), DecodeError> {
        let original = b"The quick brown fox jumps over the lazy dog.";
        let expected = "54686520717569636B2062726F776E20666F78206A756D7073206F76\
        657220746865206C617A7920646F672E";
        let encoded = HEXUPPER.encode(original);
        assert_eq!(encoded, expected);
        Ok(())
      }
      
      Rust language logo

      Encode to hex

      Codiga's Rust Recipes

      encode using HEXUPPER

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.