0.1.1-develop.275 • Published 2 years 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-mathUsage
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 00.1.1-develop.275
2 years ago
0.1.1-develop.274
2 years ago
0.1.1-develop.174
3 years ago
0.1.1-develop.172
3 years ago
0.1.1-develop.168
3 years ago
0.1.1-develop.166
3 years ago
0.1.1-develop.159
3 years ago