complete anybase

This commit is contained in:
askiiart 2025-01-13 22:43:53 -06:00
parent aa12db5ec7
commit 6c7563455f
Signed by untrusted user who does not match committer: askiiart
GPG key ID: 6A32977DAF31746A
3 changed files with 37 additions and 10 deletions

View file

@ -13,7 +13,6 @@ pub fn num_to_cat(num: u32, alphabet: Vec<String>, char_length: u32) -> String {
let base: u32 = alphabet.len() as u32;
// base*n*-ifying logic
// FIXME: With base 10 this loops 100 times? see `anybase::test_anybase_encode()`
let mut nums: Vec<u32> = Vec::new();
while (nums.len() as u32) < char_length {
nums.push((num as u32) % base);