pub fn from_string(v: String) -> RawBytes<String>Expand description
Create a raw-byte hashable value from a string.
This hashes the UTF-8 bytes of the string without Rust’s string length prefix.
§Examples
assert_eq!(
calculate_hash(from_string("abc".to_owned())),
calculate_hash(from_str("abc"))
);
assert!(from_string(String::new()).is_empty());
assert!(!from_string("abc".to_string()).is_empty());