string_to_bytes

Function string_to_bytes 

Source
pub fn string_to_bytes(s: &str) -> Vec<u8> 
Expand description

Converts a string to a byte vector using UTF-8 encoding.

§Arguments

  • s - A string slice (&str) to be converted to bytes.

§Returns

A Vec<u8> containing the UTF-8 encoded bytes of the input string.

§Examples

use keeper_secrets_manager_core::utils::string_to_bytes;
let input = "Hello, world!";
let bytes = string_to_bytes(input);
assert_eq!(bytes, b"Hello, world!");