add full anybase functionality

This commit is contained in:
askiiart 2025-01-14 16:09:28 -06:00
parent 500888f5e7
commit 8aeac4fb5d
Signed by untrusted user who does not match committer: askiiart
GPG key ID: 6A32977DAF31746A
2 changed files with 66 additions and 3 deletions

View file

@ -65,7 +65,8 @@ pub fn cat_to_num(text: Vec<String>, alphabet: Vec<String>, char_length: u32) ->
///
/// assert_eq!(vec!["meow meow mrrp".to_string(), "meow mreow mrrp".to_string(), "mreow meow mrrp".to_string()], split_every_x("meow meow mrrp meow mreow mrrp mreow meow mrrp".to_string(), 3));
/// ```
pub fn split_every_x(text: String, x: usize) -> Vec<String> {
pub fn split_every_x(text: String, x: u32) -> Vec<String> {
let x = x as usize;
let delim = " ";
let tmp: Vec<String> = text.split(delim).map(|item| item.to_string()).collect();
let mut output: Vec<String> = Vec::new();