complete anybase
This commit is contained in:
parent
aa12db5ec7
commit
6c7563455f
3 changed files with 37 additions and 10 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue