base95 0.1.1

Textual representation of base 95 fractional numbers with arbitrary precision
Documentation
  • Coverage
  • 20%
    2 out of 10 items documented1 out of 8 items with examples
  • Size
  • Source code size: 13.74 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.82 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • seungha-kim/base95
    5 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • seungha-kim

base95

Textual representation of base 95 fractional numbers with arbitrary precision, intended to be used in real-time collaborative applications.

Documentation

Example

use base95::Base95;
use std::str::FromStr;

fn main() {
    let n1 = Base95::mid();
    assert_eq!(n1.to_string(), "O");
    assert_eq!(n1.raw_digits(), vec![47]);

    let n2 = Base95::avg_with_zero(&n1);
    assert_eq!(n2.to_string(), "7");
    assert_eq!(n2.raw_digits(), vec![23]);

    let n3 = Base95::avg_with_one(&n1);
    assert_eq!(n3.to_string(), "g");
    assert_eq!(n3.raw_digits(), vec![71]);

    let n4 = Base95::avg(&n1, &n2);
    assert_eq!(n4.to_string(), "C");
    assert_eq!(n4.raw_digits(), vec![35]);

    let n5 = Base95::from_str("j>Z= 4").unwrap();
    assert_eq!(n5.raw_digits(), vec![74, 30, 58, 29, 0, 20]);
}