kaktovik

Crates.iokaktovik
lib.rskaktovik
version0.2.2
created_at2023-04-24 18:53:06.003414+00
updated_at2026-01-05 19:39:45.974986+00
descriptionFormat a number in Kaktovik numerals
homepage
repositoryhttps://gitlab.com/sw0x2A/kaktovik
max_upload_size
id847728
size18,081
Stefan Warten (sw0x2A)

documentation

https://docs.rs/kaktovik

README

A library for managing Kaktovik Iñupiaq numerals.

Kaktovik numerals are a base-20 system used by the Iñupiat of Alaska. This crate allows for parsing, formatting, and arithmetic operations on these numerals, backed by standard Rust usize integers.

Features

  • Zero-allocation parsing: Uses efficient arithmetic for parsing.
  • Zero-allocation formatting: Uses stack buffers for displaying numbers.
  • Serde support: Serializes directly to Kaktovik strings.

Examples

use kaktovik::Numeral;

fn main() {
    // Parse a Kaktovik string (20 + 2 = 22)
    let n: Numeral = "𝋁𝋂".parse().unwrap();
    assert_eq!(n.to_usize(), 22);
    
    // Arithmetic
    let sum = n + Numeral::new(10);
    assert_eq!(sum.to_usize(), 32);
    
    // Formatting
    println!("The number is: {sum}");
}
Commit count: 28

cargo fmt