bigint-crypto-utils
Advanced tools
Comparing version 3.1.6 to 3.1.7
@@ -13,3 +13,3 @@ /** | ||
/** | ||
* Returns the bitlength of a number | ||
* Returns the (minimum) length of a number expressed in bits. | ||
* | ||
@@ -16,0 +16,0 @@ * @param a |
@@ -13,3 +13,3 @@ /** | ||
/** | ||
* Returns the bitlength of a number | ||
* Returns the (minimum) length of a number expressed in bits. | ||
* | ||
@@ -16,0 +16,0 @@ * @param a |
@@ -13,3 +13,3 @@ /** | ||
/** | ||
* Returns the bitlength of a number | ||
* Returns the (minimum) length of a number expressed in bits. | ||
* | ||
@@ -16,0 +16,0 @@ * @param a |
@@ -1,2 +0,2 @@ | ||
# bigint-crypto-utils - v3.1.6 | ||
# bigint-crypto-utils - v3.1.7 | ||
@@ -56,3 +56,3 @@ ## Table of contents | ||
Returns the bitlength of a number | ||
Returns the (minimum) length of a number expressed in bits. | ||
@@ -159,3 +159,3 @@ #### Parameters | ||
[src/ts/isProbablyPrime.ts:20](https://github.com/juanelas/bigint-crypto-utils/blob/3138bfa/src/ts/isProbablyPrime.ts#L20) | ||
[src/ts/isProbablyPrime.ts:20](https://github.com/juanelas/bigint-crypto-utils/blob/b967f95/src/ts/isProbablyPrime.ts#L20) | ||
@@ -327,3 +327,3 @@ ___ | ||
[src/ts/prime.ts:28](https://github.com/juanelas/bigint-crypto-utils/blob/3138bfa/src/ts/prime.ts#L28) | ||
[src/ts/prime.ts:28](https://github.com/juanelas/bigint-crypto-utils/blob/b967f95/src/ts/prime.ts#L28) | ||
@@ -358,3 +358,3 @@ ___ | ||
[src/ts/prime.ts:109](https://github.com/juanelas/bigint-crypto-utils/blob/3138bfa/src/ts/prime.ts#L109) | ||
[src/ts/prime.ts:109](https://github.com/juanelas/bigint-crypto-utils/blob/b967f95/src/ts/prime.ts#L109) | ||
@@ -388,3 +388,3 @@ ___ | ||
[src/ts/randBetween.ts:14](https://github.com/juanelas/bigint-crypto-utils/blob/3138bfa/src/ts/randBetween.ts#L14) | ||
[src/ts/randBetween.ts:14](https://github.com/juanelas/bigint-crypto-utils/blob/b967f95/src/ts/randBetween.ts#L14) | ||
@@ -418,3 +418,3 @@ ___ | ||
[src/ts/randBits.ts:13](https://github.com/juanelas/bigint-crypto-utils/blob/3138bfa/src/ts/randBits.ts#L13) | ||
[src/ts/randBits.ts:13](https://github.com/juanelas/bigint-crypto-utils/blob/b967f95/src/ts/randBits.ts#L13) | ||
@@ -448,3 +448,3 @@ ___ | ||
[src/ts/randBits.ts:43](https://github.com/juanelas/bigint-crypto-utils/blob/3138bfa/src/ts/randBits.ts#L43) | ||
[src/ts/randBits.ts:43](https://github.com/juanelas/bigint-crypto-utils/blob/b967f95/src/ts/randBits.ts#L43) | ||
@@ -478,3 +478,3 @@ ___ | ||
[src/ts/randBytes.ts:13](https://github.com/juanelas/bigint-crypto-utils/blob/3138bfa/src/ts/randBytes.ts#L13) | ||
[src/ts/randBytes.ts:13](https://github.com/juanelas/bigint-crypto-utils/blob/b967f95/src/ts/randBytes.ts#L13) | ||
@@ -509,3 +509,3 @@ ___ | ||
[src/ts/randBytes.ts:45](https://github.com/juanelas/bigint-crypto-utils/blob/3138bfa/src/ts/randBytes.ts#L45) | ||
[src/ts/randBytes.ts:45](https://github.com/juanelas/bigint-crypto-utils/blob/b967f95/src/ts/randBytes.ts#L45) | ||
@@ -512,0 +512,0 @@ ___ |
{ | ||
"name": "bigint-crypto-utils", | ||
"version": "3.1.6", | ||
"version": "3.1.7", | ||
"description": "Arbitrary precision modular arithmetic, cryptographically secure random numbers and strong probable prime generation/testing. It works in modern browsers, Angular, React, Node.js, etc. since it uses the native JS implementation of BigInt", | ||
@@ -46,2 +46,8 @@ "keywords": [ | ||
}, | ||
"imports": { | ||
"#pkg": { | ||
"import": "./dist/esm/index.node.js", | ||
"require": "./dist/cjs/index.node.cjs" | ||
} | ||
}, | ||
"directories": { | ||
@@ -52,3 +58,5 @@ "build": "./build", | ||
"src": "./src", | ||
"test": "./test" | ||
"test": "./test", | ||
"benchmark": "./benchmark", | ||
"mocha-ts": "./.mocha-ts" | ||
}, | ||
@@ -59,7 +67,9 @@ "scripts": { | ||
"clean": "rimraf .mocha-ts coverage dist types docs", | ||
"coverage": "c8 --clean --check-coverage --exclude-after-remap --exclude '{build,node_modules,src/ts/**/*.spec.ts,test/**/*.ts,.mocha-ts/**/*}' --reporter=text --reporter=lcov node ./build/bin/mocha-ts.js --require build/testing/mocha/mocha-init.js '{src/ts/**/*.spec.ts,test/**/*.ts}'", | ||
"coverage": "c8 --clean --check-coverage --exclude '{src/ts/**/*.spec.ts,test,test-vectors,build}' --exclude-after-remap --reporter=text --reporter=lcov node ./build/bin/mocha-ts.cjs --commonjs ", | ||
"docs": "node build/build.docs.cjs", | ||
"git:add": "git add -A", | ||
"lint": "ts-standard --fix", | ||
"mocha-ts": "node ./build/bin/mocha-ts.js --require build/testing/mocha/mocha-init.js ", | ||
"mocha-ts": "node --experimental-modules --es-module-specifier-resolution=node ./build/bin/mocha-ts.cjs ", | ||
"mocha-ts:cjs": "node ./build/bin/mocha-ts.cjs --commonjs ", | ||
"mocha-ts:watch": "npm run mocha-ts:cjs -- --watch ", | ||
"mocha-ts:browser": "node build/testing/browser/index.cjs ", | ||
@@ -70,9 +80,12 @@ "mocha-ts:browser-headless": "node build/testing/browser/index.cjs headless ", | ||
"postversion": "git push --follow-tags", | ||
"test": "run-s test:browser-headless test:node", | ||
"test:browser": "npm run mocha-ts:browser ", | ||
"test:browser-headless": "npm run mocha-ts:browser-headless ", | ||
"test:node": "npm run mocha-ts -- '{src/ts/**/*.spec.ts,test/**/*.ts}'", | ||
"watch": "npm run mocha-ts -- --watch '{src/ts/**/*.spec.ts,test/**/*.ts}'" | ||
"test": "run-s test:node test:browser-headless", | ||
"test:browser": "npm run mocha-ts:browser", | ||
"test:browser-headless": "npm run mocha-ts:browser-headless", | ||
"test:node": "run-s test:node-cjs test:node-esm", | ||
"test:node-cjs": "npm run mocha-ts:cjs ", | ||
"test:node-esm": "npm run mocha-ts ", | ||
"watch": "npm run mocha-ts:watch " | ||
}, | ||
"ts-standard": { | ||
"project": "tsconfig.json", | ||
"env": [ | ||
@@ -82,17 +95,12 @@ "mocha" | ||
"globals": [ | ||
"Blob", | ||
"postMessage", | ||
"self", | ||
"Worker", | ||
"IS_BROWSER", | ||
"browser", | ||
"page", | ||
"_pkg", | ||
"chai" | ||
], | ||
"project": "tsconfig.json", | ||
"ignore": [ | ||
"dist/**/*", | ||
"examples/**/*", | ||
"types/**/*" | ||
"types/**/*", | ||
"build/testing/mocha/mocha-init.js" | ||
] | ||
@@ -104,11 +112,11 @@ }, | ||
"@rollup/plugin-multi-entry": "^4.0.0", | ||
"@rollup/plugin-node-resolve": "^13.0.5", | ||
"@rollup/plugin-node-resolve": "^14.1.0", | ||
"@rollup/plugin-replace": "^4.0.0", | ||
"@rollup/plugin-typescript": "^8.2.0", | ||
"@types/chai": "^4.2.22", | ||
"@types/mocha": "^9.0.0", | ||
"@types/mocha": "^10.0.0", | ||
"c8": "^7.12.0", | ||
"chai": "^4.3.3", | ||
"dotenv": "^16.0.0", | ||
"fs-extra": "^10.0.0", | ||
"dotenv": "^16.0.3", | ||
"fs-extra": "^10.1.0", | ||
"glob": "^8.0.1", | ||
@@ -120,3 +128,3 @@ "json5": "^2.2.0", | ||
"pirates": "^4.0.1", | ||
"puppeteer": "^15.5.0", | ||
"puppeteer": "^18.0.5", | ||
"rimraf": "^3.0.2", | ||
@@ -123,0 +131,0 @@ "rollup": "^2.57.0", |
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) | ||
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) | ||
[![Node.js CI](https://github.com/juanelas/bigint-crypto-utils/workflows/build/badge.svg)](https://github.com/juanelas/bigint-crypto-utils/actions?query=workflow%3A%22build%22) | ||
[![Coverage Status](https://coveralls.io/repos/github/juanelas/bigint-crypto-utils/badge.svg?branch=master)](https://coveralls.io/github/juanelas/bigint-crypto-utils?branch=master) | ||
[![Node.js CI](https://github.com/juanelas/bigint-crypto-utils/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/juanelas/bigint-crypto-utils/actions/workflows/build-and-test.yml) | ||
[![Coverage Status](https://coveralls.io/repos/github/juanelas/bigint-crypto-utils/badge.svg?branch=main)](https://coveralls.io/github/juanelas/bigint-crypto-utils?branch=main) | ||
@@ -43,3 +43,3 @@ # bigint-crypto-utils | ||
You can also download the [IIFE bundle](https://raw.githubusercontent.com/juanelas/bigint-crypto-utils/master/dist/bundles/iife.js), the [ESM bundle](https://raw.githubusercontent.com/juanelas/bigint-crypto-utils/master/dist/bundles/esm.min.js) or the [UMD bundle](https://raw.githubusercontent.com/juanelas/bigint-crypto-utils/master/dist/bundles/umd.js) and manually add it to your project, or, if you have already installed `bigint-crypto-utils` in your project, just get the bundles from `node_modules/bigint-crypto-utils/dist/bundles/`. | ||
You can also download the [IIFE bundle](https://raw.githubusercontent.com/juanelas/bigint-crypto-utils/main/dist/bundles/iife.js), the [ESM bundle](https://raw.githubusercontent.com/juanelas/bigint-crypto-utils/main/dist/bundles/esm.min.js) or the [UMD bundle](https://raw.githubusercontent.com/juanelas/bigint-crypto-utils/main/dist/bundles/umd.js) and manually add it to your project, or, if you have already installed `bigint-crypto-utils` in your project, just get the bundles from `node_modules/bigint-crypto-utils/dist/bundles/`. | ||
@@ -65,9 +65,9 @@ An example of usage could be (complete examples can be found in the [examples](https://github.com/juanelas/bigint-crypto-utils/tree/master/examples) directory): | ||
console.log(bigintCryptoUtils.randBetween(2n ** 256n)) // Prints a cryptographically secure random number between 1 and 2**256 (both included). | ||
console.log(bigintCryptoUtils.randBetween(2n ** 256n)) // prints a cryptographically secure random number between 1 and 2**256 (both included). | ||
async function primeTesting (): void { | ||
// Output of a probable prime of 2048 bits | ||
// Let us print out a probable prime of 2048 bits | ||
console.log(await bigintCryptoUtils.prime(2048)) | ||
// Testing if a number is a probable prime (Miller-Rabin) | ||
// Testing if number is a probable prime (Miller-Rabin) | ||
const number = 27n | ||
@@ -74,0 +74,0 @@ const isPrime = await bigintCryptoUtils.isProbablyPrime(number) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
267608