1.1.2 • Published 4 years ago

bitmath v1.1.2

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

:keycap_ten: abacus npm downloads version

bit arithmetic package to add, subtract, multiply, euclidean divide bit arrays of any size.

Uses Uint1Array.

get

npm i --save bitmath

api

import m from 'bitmath';
import Uint1Array from 'uint1array';

x = m.from(28);               // create bit field from number 28
y = Uint1Array.of(1,1,1);     // or just create using Uint1Array TypedArray
z = Uint1Array.of(0,1);

m.add(x,y)
m.mul(x,y)
m.div(x,y)
m.dif(x,y)                    // subtract (note: sign is omitted)
m.mod(x,y)
m.modexp(x,y,x)

Timesafe Notes

Modexp using repeated squaring in a (trying to be) timesafe way is implemented.

1.1.1

4 years ago

1.1.2

4 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago