0.1.1-develop.275 • Published 12 months ago
@zkfs/safe-math v0.1.1-develop.275
Safe Math Library for Snarkyjs
This npm package provides a safe math library for developers working with Snarkyjs.
The library is designed to ensure that all math calculations are performed securely, without having to worry about potential security issues, such as underflows or division by zero.
Quickstart
npm install @zkfs/safe-math
Usage
import { UInt64 } from 'snarkyjs';
// subtraction
safeUint64Sub(UInt64.from(2), UInt64.from(1)) // returns 1
safeUint64Sub(UInt64.from(1), UInt64.from(2)) // returns 0
// division
safeUint64Div(UInt64.from(10), UInt64.from(5)) // returns 2
safeUint64Div(UInt64.from(10), UInt64.from(0)) // returns 0
0.1.1-develop.275
12 months ago
0.1.1-develop.274
12 months ago
0.1.1-develop.174
1 year ago
0.1.1-develop.172
1 year ago
0.1.1-develop.168
1 year ago
0.1.1-develop.166
1 year ago
0.1.1-develop.159
1 year ago