Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aztec/foundation

Package Overview
Dependencies
Maintainers
6
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aztec/foundation - npm Package Compare versions

Comparing version 0.1.0-alpha30 to 0.1.0-alpha31

2

dest/fields/fields.d.ts

@@ -17,3 +17,3 @@ /// <reference types="node" resolution-mode="require"/>

readonly value: bigint;
constructor(value: bigint | number);
constructor(value: bigint | number | Fr);
/**

@@ -20,0 +20,0 @@ * Generates a random Fr or Fq instance with a value modulo the respective class' MODULUS.

@@ -11,4 +11,5 @@ import { toBigIntBE, toBufferBE, toHex } from '../bigint-buffer/index.js';

constructor(value) {
this.value = BigInt(value);
if (value > Fr.MAX_VALUE) {
const isFr = (value) => !!value.toBigInt;
this.value = isFr(value) ? value.toBigInt() : BigInt(value);
if (this.value > Fr.MAX_VALUE) {
throw new Error(`Fr out of range ${value}.`);

@@ -219,2 +220,2 @@ }

Fq.SIZE_IN_BYTES = 32;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmllbGRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ZpZWxkcy9maWVsZHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxVQUFVLEVBQUUsS0FBSyxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFDMUUsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQ2pELE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUU3RDs7OztHQUlHO0FBQ0gsTUFBTSxPQUFPLEVBQUU7SUFXYixZQUFZLEtBQXNCO1FBQ2hDLElBQUksQ0FBQyxLQUFLLEdBQUcsTUFBTSxDQUFDL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7UUFDTixPQUFPLEtBQUssQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUM7SUFDM0IsQ0FBQztJQUVEOzs7Ozs7T0FNRztJQUNILE1BQU07UUFDSixPQUFPLElBQUksQ0FBQyxLQUFLLEtBQUssRUFBRSxDQUFDO0lBQzNCLENBQUM7SUFFRDs7Ozs7T0FLRztJQUNILGNBQWM7UUFDWixPQUFPLElBQUksQ0FBQyxRQUFRLEVBQUUsQ0FBQztJQUN6QixDQUFDOztBQWhGTSxVQUFPLEdBQUcsbUVBQW1FLENBQUM7QUFDOUUsWUFBUyxHQUFHLEVBQUUsQ0FBQyxPQUFPLEdBQUcsRUFBRSxDQUFDO0FBQzVCLGdCQUFhLEdBQUcsRUFBRSxDQUFDIn0=
{
"name": "@aztec/foundation",
"version": "0.1.0-alpha30",
"version": "0.1.0-alpha31",
"exports": {

@@ -5,0 +5,0 @@ "./eslint": "./.eslintrc.cjs",

@@ -21,5 +21,6 @@ import { toBigIntBE, toBufferBE, toHex } from '../bigint-buffer/index.js';

constructor(value: bigint | number) {
this.value = BigInt(value);
if (value > Fr.MAX_VALUE) {
constructor(value: bigint | number | Fr) {
const isFr = (value: bigint | number | Fr): value is Fr => !!(value as Fr).toBigInt;
this.value = isFr(value) ? value.toBigInt() : BigInt(value);
if (this.value > Fr.MAX_VALUE) {
throw new Error(`Fr out of range ${value}.`);

@@ -26,0 +27,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc