From 905ba660c2ae9392a91cb4bae71cb60f2175ad85 Mon Sep 17 00:00:00 2001 From: Juanra Dikal Date: Mon, 1 Aug 2022 04:05:16 +0200 Subject: [PATCH] fix coverage script --- docs/.nojekyll | 1 - docs/API.md | 292 ---------------------------------------- docs/interfaces/Egcd.md | 39 ------ package.json | 2 +- 4 files changed, 1 insertion(+), 333 deletions(-) delete mode 100644 docs/.nojekyll delete mode 100644 docs/API.md delete mode 100644 docs/interfaces/Egcd.md diff --git a/docs/.nojekyll b/docs/.nojekyll deleted file mode 100644 index e2ac661..0000000 --- a/docs/.nojekyll +++ /dev/null @@ -1 +0,0 @@ -TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/docs/API.md b/docs/API.md deleted file mode 100644 index fe62a07..0000000 --- a/docs/API.md +++ /dev/null @@ -1,292 +0,0 @@ -# bigint-mod-arith - v3.0.2 - -Some common functions for modular arithmetic using native JS implementation of BigInt - -## Table of contents - -### Interfaces - -- [Egcd](interfaces/Egcd.md) - -### Functions - -- [abs](API.md#abs) -- [bitLength](API.md#bitlength) -- [eGcd](API.md#egcd) -- [gcd](API.md#gcd) -- [lcm](API.md#lcm) -- [max](API.md#max) -- [min](API.md#min) -- [modInv](API.md#modinv) -- [modPow](API.md#modpow) -- [toZn](API.md#tozn) - -## Functions - -### abs - -▸ **abs**(`a`): `number` \| `bigint` - -Absolute value. abs(a)==a if a>=0. abs(a)==-a if a<0 - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `a` | `number` \| `bigint` | - -#### Returns - -`number` \| `bigint` - -The absolute value of a - -#### Defined in - -[abs.ts:8](https://github.com/juanelas/bigint-mod-arith/blob/e29be71/src/ts/abs.ts#L8) - -___ - -### bitLength - -▸ **bitLength**(`a`): `number` - -Returns the bitlength of a number - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `a` | `number` \| `bigint` | - -#### Returns - -`number` - -The bit length - -#### Defined in - -[bitLength.ts:7](https://github.com/juanelas/bigint-mod-arith/blob/e29be71/src/ts/bitLength.ts#L7) - -___ - -### eGcd - -▸ **eGcd**(`a`, `b`): [`Egcd`](interfaces/Egcd.md) - -An iterative implementation of the extended euclidean algorithm or extended greatest common divisor algorithm. -Take positive integers a, b as input, and return a triple (g, x, y), such that ax + by = g = gcd(a, b). - -**`Throws`** - -This excepction is thrown if a or b are less than 0 - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `a` | `number` \| `bigint` | -| `b` | `number` \| `bigint` | - -#### Returns - -[`Egcd`](interfaces/Egcd.md) - -A triple (g, x, y), such that ax + by = g = gcd(a, b). - -#### Defined in - -[egcd.ts:18](https://github.com/juanelas/bigint-mod-arith/blob/e29be71/src/ts/egcd.ts#L18) - -___ - -### gcd - -▸ **gcd**(`a`, `b`): `bigint` - -Greatest-common divisor of two integers based on the iterative binary algorithm. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `a` | `number` \| `bigint` | -| `b` | `number` \| `bigint` | - -#### Returns - -`bigint` - -The greatest common divisor of a and b - -#### Defined in - -[gcd.ts:10](https://github.com/juanelas/bigint-mod-arith/blob/e29be71/src/ts/gcd.ts#L10) - -___ - -### lcm - -▸ **lcm**(`a`, `b`): `bigint` - -The least common multiple computed as abs(a*b)/gcd(a,b) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `a` | `number` \| `bigint` | -| `b` | `number` \| `bigint` | - -#### Returns - -`bigint` - -The least common multiple of a and b - -#### Defined in - -[lcm.ts:10](https://github.com/juanelas/bigint-mod-arith/blob/e29be71/src/ts/lcm.ts#L10) - -___ - -### max - -▸ **max**(`a`, `b`): `number` \| `bigint` - -Maximum. max(a,b)==a if a>=b. max(a,b)==b if a<=b - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `a` | `number` \| `bigint` | -| `b` | `number` \| `bigint` | - -#### Returns - -`number` \| `bigint` - -Maximum of numbers a and b - -#### Defined in - -[max.ts:9](https://github.com/juanelas/bigint-mod-arith/blob/e29be71/src/ts/max.ts#L9) - -___ - -### min - -▸ **min**(`a`, `b`): `number` \| `bigint` - -Minimum. min(a,b)==b if a>=b. min(a,b)==a if a<=b - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `a` | `number` \| `bigint` | -| `b` | `number` \| `bigint` | - -#### Returns - -`number` \| `bigint` - -Minimum of numbers a and b - -#### Defined in - -[min.ts:9](https://github.com/juanelas/bigint-mod-arith/blob/e29be71/src/ts/min.ts#L9) - -___ - -### modInv - -▸ **modInv**(`a`, `n`): `bigint` - -Modular inverse. - -**`Throws`** - -Excpeption thorwn when a does not have inverse modulo n - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `a` | `number` \| `bigint` | The number to find an inverse for | -| `n` | `number` \| `bigint` | The modulo | - -#### Returns - -`bigint` - -The inverse modulo n - -#### Defined in - -[modInv.ts:14](https://github.com/juanelas/bigint-mod-arith/blob/e29be71/src/ts/modInv.ts#L14) - -___ - -### modPow - -▸ **modPow**(`b`, `e`, `n`): `bigint` - -Modular exponentiation b**e mod n. Currently using the right-to-left binary method - -**`Throws`** - -Excpeption thrown when n is not > 0 - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `b` | `number` \| `bigint` | base | -| `e` | `number` \| `bigint` | exponent | -| `n` | `number` \| `bigint` | modulo | - -#### Returns - -`bigint` - -b**e mod n - -#### Defined in - -[modPow.ts:16](https://github.com/juanelas/bigint-mod-arith/blob/e29be71/src/ts/modPow.ts#L16) - -___ - -### toZn - -▸ **toZn**(`a`, `n`): `bigint` - -Finds the smallest positive element that is congruent to a in modulo n - -**`Remarks`** - -a and b must be the same type, either number or bigint - -**`Throws`** - -Excpeption thrown when n is not > 0 - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `a` | `number` \| `bigint` | An integer | -| `n` | `number` \| `bigint` | The modulo | - -#### Returns - -`bigint` - -A bigint with the smallest positive representation of a modulo n - -#### Defined in - -[toZn.ts:15](https://github.com/juanelas/bigint-mod-arith/blob/e29be71/src/ts/toZn.ts#L15) diff --git a/docs/interfaces/Egcd.md b/docs/interfaces/Egcd.md deleted file mode 100644 index f72037f..0000000 --- a/docs/interfaces/Egcd.md +++ /dev/null @@ -1,39 +0,0 @@ -# Interface: Egcd - -## Table of contents - -### Properties - -- [g](Egcd.md#g) -- [x](Egcd.md#x) -- [y](Egcd.md#y) - -## Properties - -### g - -• **g**: `bigint` - -#### Defined in - -[egcd.ts:2](https://github.com/juanelas/bigint-mod-arith/blob/e29be71/src/ts/egcd.ts#L2) - -___ - -### x - -• **x**: `bigint` - -#### Defined in - -[egcd.ts:3](https://github.com/juanelas/bigint-mod-arith/blob/e29be71/src/ts/egcd.ts#L3) - -___ - -### y - -• **y**: `bigint` - -#### Defined in - -[egcd.ts:4](https://github.com/juanelas/bigint-mod-arith/blob/e29be71/src/ts/egcd.ts#L4) diff --git a/package.json b/package.json index 4797e10..6fba31a 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "build": "run-s lint build:js docs", "build:js": "rollup -c build/rollup.config.js", "clean": "rimraf .nyc_output .mocha-ts coverage dist types docs", - "coverage": "nyc --check-coverage --exclude build --exclude '{src/ts/**/*.spec.ts,test/**/*.ts,.mocha-ts/**/*}' --reporter=text --reporter=lcov node ./build/bin/mocha-ts.cjs --require build/testing/mocha/mocha-init.js '{src/ts/**/*.spec.ts,test/**/*.ts}'", + "coverage": "nyc --check-coverage --exclude build --exclude '{src/ts/**/*.spec.ts,test/**/*.ts,.mocha-ts/**/*}' --reporter=text --reporter=lcov node ./build/bin/mocha-ts.cjs --require build/testing/mocha/mocha-init.cjs '{src/ts/**/*.spec.ts,test/**/*.ts}'", "docs": "node build/build.docs.cjs", "git:add": "git add -A", "lint": "ts-standard --fix",