Skip to main content

to_numeric

Function to_numeric 

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

Converts a given string slice into a vector of numeric byte values.

§Arguments

  • s - A string slice (&str) that will be converted into a vector of numeric byte values.

§Returns

A Vec<u8> containing numeric byte representations of the characters in the input string.

§Example

use old_crypto_rs::helpers::to_numeric;

let result = to_numeric("hello");
assert_eq!(result, vec![1, 0, 2, 3, 4]);

§Notes

This function is a wrapper around the numeric_by_key function, passing the input string, a closure that directly maps its bytes, and a false boolean flag. Refer to the numeric_by_key function for more details on the behavior and use.