yali 0.1.1

Yet Another LargeInt Library
Documentation
  • Coverage
  • 66.67%
    2 out of 3 items documented1 out of 3 items with examples
  • Size
  • Source code size: 55.82 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 475.25 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 15s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • vanten-s/yali
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • vanten-s

yali

Yali is a library for representing, and doing arithmetic with, large numbers.

Warnings

  1. This library only supports positive integers.
  2. This isn't the most efficient library. This is just one of my small side projects.

Examples

Parse hex value from string:

use yali::Number;

let num_hex = "ab32fa1689fbc2c2631d4343bad3ab2155d";
let num: Number<16> = num_hex.parse().unwrap();

Regular exponentiation

use yali::Number;

let a = Number::<16>::from(2u64);
let b = Number::<16>::from(4u64);
let c = a ^ b;
assert_eq!(c, Number::<16>::from(16u64));

Modular exponentiation

use yali::Number;

let a: Number<16> = "ab32fa1689fbc2c2631d4343bad3ab2155d".parse().unwrap();
let b: Number<16> = "10001".parse().unwrap();
let n: Number<16> = "4343bad3ab2155d89fbc28c2631d".parse().unwrap();
let num = a.mod_exponentiation(b, n);