Trait phollaits::ToHex[][src]

pub trait ToHex {
    fn hexify(self) -> String;
fn hexify_upper(self) -> String; }

Required methods

Implementors

converts a value (implementing AsRef<u8>; this includes String, str, Vec and u8) to hex.

Example

use phollaits::{ToHex};

fn main() {
	let value = "myValue!";
	assert_eq!(value.hexify(), "6d7956616c756521".to_string())
}

converts a value (implementing AsRef<u8>; this includes String, str, Vec and u8) to hex (UPPER_CASE).

Example

use phollaits::{ToHex};

fn main() {
	let value = "myValue!";
	assert_eq!(value.hexify_upper(), "6D7956616C756521".to_string())
}