some typos fixed
This commit is contained in:
parent
7e8eb16aaa
commit
4db2e2cf60
16
README.md
16
README.md
|
@ -25,18 +25,18 @@ Import your module as :
|
||||||
|
|
||||||
- Node.js
|
- Node.js
|
||||||
```javascript
|
```javascript
|
||||||
const bigintCryptoUtils = require('bigint-mod-arith')
|
const bigintModArith = require('bigint-mod-arith')
|
||||||
... // your code here
|
... // your code here
|
||||||
```
|
```
|
||||||
- JavaScript native project
|
- JavaScript native project
|
||||||
```javascript
|
```javascript
|
||||||
import * as bigintCryptoUtils from 'bigint-mod-arith'
|
import * as bigintModArith from 'bigint-mod-arith'
|
||||||
... // your code here
|
... // your code here
|
||||||
```
|
```
|
||||||
- Javascript native browser ES6 mod
|
- JavaScript native browser ES6 mod
|
||||||
```html
|
```html
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import * as bigintCryptoUtils from 'lib/index.browser.bundle.mod.js' // Use you actual path to the broser mod bundle
|
import * as bigintModArith from 'lib/index.browser.bundle.mod.js' // Use you actual path to the broser mod bundle
|
||||||
... // your code here
|
... // your code here
|
||||||
</script>
|
</script>
|
||||||
import as bcu from 'bigint-mod-arith'
|
import as bcu from 'bigint-mod-arith'
|
||||||
|
@ -50,7 +50,7 @@ Import your module as :
|
||||||
</script>
|
</script>
|
||||||
- TypeScript
|
- TypeScript
|
||||||
```typescript
|
```typescript
|
||||||
import * as bigintCryptoUtils from 'bigint-mod-arith'
|
import * as bigintModArith from 'bigint-mod-arith'
|
||||||
... // your code here
|
... // your code here
|
||||||
```
|
```
|
||||||
> BigInt is [ES-2020](https://tc39.es/ecma262/#sec-bigint-objects). In order to use it with TypeScript you should set `lib` (and probably also `target` and `module`) to `esnext` in `tsconfig.json`.
|
> BigInt is [ES-2020](https://tc39.es/ecma262/#sec-bigint-objects). In order to use it with TypeScript you should set `lib` (and probably also `target` and `module`) to `esnext` in `tsconfig.json`.
|
||||||
|
@ -66,11 +66,11 @@ const a = BigInt('5')
|
||||||
const b = BigInt('2')
|
const b = BigInt('2')
|
||||||
const n = BigInt('19')
|
const n = BigInt('19')
|
||||||
|
|
||||||
console.log(bigintCryptoUtils.modPow(a, b, n)) // prints 6
|
console.log(bigintModArith.modPow(a, b, n)) // prints 6
|
||||||
|
|
||||||
console.log(bigintCryptoUtils.modInv(BigInt('2'), BigInt('5'))) // prints 3
|
console.log(bigintModArith.modInv(BigInt('2'), BigInt('5'))) // prints 3
|
||||||
|
|
||||||
console.log(bigintCryptoUtils.modInv(BigInt('3'), BigInt('5'))) // prints 2
|
console.log(bigintModArith.modInv(BigInt('3'), BigInt('5'))) // prints 2
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -25,18 +25,18 @@ Import your module as :
|
||||||
|
|
||||||
- Node.js
|
- Node.js
|
||||||
```javascript
|
```javascript
|
||||||
const bigintCryptoUtils = require('bigint-mod-arith')
|
const bigintModArith = require('bigint-mod-arith')
|
||||||
... // your code here
|
... // your code here
|
||||||
```
|
```
|
||||||
- JavaScript native project
|
- JavaScript native project
|
||||||
```javascript
|
```javascript
|
||||||
import * as bigintCryptoUtils from 'bigint-mod-arith'
|
import * as bigintModArith from 'bigint-mod-arith'
|
||||||
... // your code here
|
... // your code here
|
||||||
```
|
```
|
||||||
- Javascript native browser ES6 mod
|
- JavaScript native browser ES6 mod
|
||||||
```html
|
```html
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import * as bigintCryptoUtils from 'lib/index.browser.bundle.mod.js' // Use you actual path to the broser mod bundle
|
import * as bigintModArith from 'lib/index.browser.bundle.mod.js' // Use you actual path to the broser mod bundle
|
||||||
... // your code here
|
... // your code here
|
||||||
</script>
|
</script>
|
||||||
import as bcu from 'bigint-mod-arith'
|
import as bcu from 'bigint-mod-arith'
|
||||||
|
@ -50,7 +50,7 @@ Import your module as :
|
||||||
</script>
|
</script>
|
||||||
- TypeScript
|
- TypeScript
|
||||||
```typescript
|
```typescript
|
||||||
import * as bigintCryptoUtils from 'bigint-mod-arith'
|
import * as bigintModArith from 'bigint-mod-arith'
|
||||||
... // your code here
|
... // your code here
|
||||||
```
|
```
|
||||||
> BigInt is [ES-2020](https://tc39.es/ecma262/#sec-bigint-objects). In order to use it with TypeScript you should set `lib` (and probably also `target` and `module`) to `esnext` in `tsconfig.json`.
|
> BigInt is [ES-2020](https://tc39.es/ecma262/#sec-bigint-objects). In order to use it with TypeScript you should set `lib` (and probably also `target` and `module`) to `esnext` in `tsconfig.json`.
|
||||||
|
@ -66,11 +66,11 @@ const a = BigInt('5')
|
||||||
const b = BigInt('2')
|
const b = BigInt('2')
|
||||||
const n = BigInt('19')
|
const n = BigInt('19')
|
||||||
|
|
||||||
console.log(bigintCryptoUtils.modPow(a, b, n)) // prints 6
|
console.log(bigintModArith.modPow(a, b, n)) // prints 6
|
||||||
|
|
||||||
console.log(bigintCryptoUtils.modInv(BigInt('2'), BigInt('5'))) // prints 3
|
console.log(bigintModArith.modInv(BigInt('2'), BigInt('5'))) // prints 3
|
||||||
|
|
||||||
console.log(bigintCryptoUtils.modInv(BigInt('3'), BigInt('5'))) // prints 2
|
console.log(bigintModArith.modInv(BigInt('3'), BigInt('5'))) // prints 2
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue