[][src]Function artichoke_backend::extn::stdlib::securerandom::hex::encode

pub fn encode<T>(data: T) -> String where
    T: AsRef<[u8]>, 

Encode arbitrary octets as base16. Returns a String.

This function allocates a String and delegates to encode_into.

Examples

let data = b"Artichoke Ruby";
let buf = scolapasta_hex::encode(data);
assert_eq!(buf, "4172746963686f6b652052756279");