fixes pull request #13 - Fixed randBetween example comment
This commit is contained in:
parent
f7ac709032
commit
9f9a367d72
|
@ -67,7 +67,7 @@ console.log(bigintCryptoUtils.modInv(2n, 5n)) // prints 3
|
||||||
|
|
||||||
console.log(bigintCryptoUtils.modInv(BigInt('3'), BigInt('5'))) // prints 2
|
console.log(bigintCryptoUtils.modInv(BigInt('3'), BigInt('5'))) // prints 2
|
||||||
|
|
||||||
console.log(bigintCryptoUtils.randBetween(2n ** 256n)) // Prints a cryptographically secure random number between 1 and 2**256 bits.
|
console.log(bigintCryptoUtils.randBetween(2n ** 256n)) // Prints a cryptographically secure random number between 1 and 2**256 (both included).
|
||||||
|
|
||||||
async function primeTesting (): void {
|
async function primeTesting (): void {
|
||||||
// Output of a probable prime of 2048 bits
|
// Output of a probable prime of 2048 bits
|
||||||
|
|
16
docs/API.md
16
docs/API.md
|
@ -153,7 +153,7 @@ A promise that resolves to a boolean that is either true (a probably prime numbe
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/ts/isProbablyPrime.ts:21](https://github.com/juanelas/bigint-crypto-utils/blob/87b061a/src/ts/isProbablyPrime.ts#L21)
|
[src/ts/isProbablyPrime.ts:21](https://github.com/juanelas/bigint-crypto-utils/blob/f7ac709/src/ts/isProbablyPrime.ts#L21)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -317,7 +317,7 @@ A promise that resolves to a bigint probable prime of bitLength bits.
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/ts/prime.ts:21](https://github.com/juanelas/bigint-crypto-utils/blob/87b061a/src/ts/prime.ts#L21)
|
[src/ts/prime.ts:21](https://github.com/juanelas/bigint-crypto-utils/blob/f7ac709/src/ts/prime.ts#L21)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -346,7 +346,7 @@ A bigint probable prime of bitLength bits.
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/ts/prime.ts:100](https://github.com/juanelas/bigint-crypto-utils/blob/87b061a/src/ts/prime.ts#L100)
|
[src/ts/prime.ts:100](https://github.com/juanelas/bigint-crypto-utils/blob/f7ac709/src/ts/prime.ts#L100)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -374,7 +374,7 @@ A cryptographically secure random bigint between [min,max]
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/ts/randBetween.ts:15](https://github.com/juanelas/bigint-crypto-utils/blob/87b061a/src/ts/randBetween.ts#L15)
|
[src/ts/randBetween.ts:15](https://github.com/juanelas/bigint-crypto-utils/blob/f7ac709/src/ts/randBetween.ts#L15)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -402,7 +402,7 @@ A Promise that resolves to a UInt8Array/Buffer (Browser/Node.js) filled with cry
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/ts/randBits.ts:14](https://github.com/juanelas/bigint-crypto-utils/blob/87b061a/src/ts/randBits.ts#L14)
|
[src/ts/randBits.ts:14](https://github.com/juanelas/bigint-crypto-utils/blob/f7ac709/src/ts/randBits.ts#L14)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -430,7 +430,7 @@ A Uint8Array/Buffer (Browser/Node.js) filled with cryptographically secure rando
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/ts/randBits.ts:45](https://github.com/juanelas/bigint-crypto-utils/blob/87b061a/src/ts/randBits.ts#L45)
|
[src/ts/randBits.ts:45](https://github.com/juanelas/bigint-crypto-utils/blob/f7ac709/src/ts/randBits.ts#L45)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -458,7 +458,7 @@ A promise that resolves to a UInt8Array/Buffer (Browser/Node.js) filled with cry
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/ts/randBytes.ts:12](https://github.com/juanelas/bigint-crypto-utils/blob/87b061a/src/ts/randBytes.ts#L12)
|
[src/ts/randBytes.ts:12](https://github.com/juanelas/bigint-crypto-utils/blob/f7ac709/src/ts/randBytes.ts#L12)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -486,7 +486,7 @@ A UInt8Array/Buffer (Browser/Node.js) filled with cryptographically secure rando
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/ts/randBytes.ts:46](https://github.com/juanelas/bigint-crypto-utils/blob/87b061a/src/ts/randBytes.ts#L46)
|
[src/ts/randBytes.ts:46](https://github.com/juanelas/bigint-crypto-utils/blob/f7ac709/src/ts/randBytes.ts#L46)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ console.log(bigintCryptoUtils.modInv(2n, 5n)) // prints 3
|
||||||
|
|
||||||
console.log(bigintCryptoUtils.modInv(BigInt('3'), BigInt('5'))) // prints 2
|
console.log(bigintCryptoUtils.modInv(BigInt('3'), BigInt('5'))) // prints 2
|
||||||
|
|
||||||
console.log(bigintCryptoUtils.randBetween(2n ** 256n)) // Prints a cryptographically secure random number between 1 and 2**256 bits.
|
console.log(bigintCryptoUtils.randBetween(2n ** 256n)) // Prints a cryptographically secure random number between 1 and 2**256 (both included).
|
||||||
|
|
||||||
async function primeTesting (): void {
|
async function primeTesting (): void {
|
||||||
// Output of a probable prime of 2048 bits
|
// Output of a probable prime of 2048 bits
|
||||||
|
|
Loading…
Reference in New Issue