Skip to content

coins/numbers-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Numbers.js

Basic number theory using the native BigInt arithmetic.

Extended Euclidean Algorithm

const { egcd } = await import('https://coins.github.io/numbers-js/numbers.js');
egcd(42n, 14n)

Modular Inverse

const { mod_inv } = await import('https://coins.github.io/numbers-js/numbers.js');
mod_inv(2n, 101n)

Modular Exponentiation

const { mod_exp } = await import('https://coins.github.io/numbers-js/numbers.js');
mod_exp(2n, 42n, 11n)

Modular Square Root

const { mod_sqrt } = await import('https://coins.github.io/numbers-js/numbers.js');
mod_sqrt(16n, 43n)

Releases

No releases published

Packages

No packages published