@tktb-tess/util-fns 0.10.1 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -46
- package/dist/bundle.js +467 -419
- package/dist/bundle.min.js +2 -2
- package/dist/icon.svg +23 -0
- package/dist/main.d.ts +6 -5
- package/dist/math.d.ts +1 -1
- package/dist/{named-error.d.ts → named_error.d.ts} +1 -1
- package/dist/util.d.ts +9 -2
- package/dist/worker_stream.d.ts +7 -0
- package/package.json +4 -4
- /package/dist/{baillie-psw.d.ts → baillie_psw.d.ts} +0 -0
- /package/dist/{pcg-minimal.d.ts → pcg_minimal.d.ts} +0 -0
- /package/dist/{u8arr-ext.d.ts → u8arr_ext.d.ts} +0 -0
- /package/dist/{xoshiro-minimal.d.ts → xoshiro_minimal.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
1
|
# util-fns
|
|
2
|
-
|
|
3
|
-
Utility functions for personal use
|
|
4
|
-
|
|
5
|
-
Available in both a browser and Node.js environment.
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm i @tktb-tess/util-fns
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
### Usage
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
import { modPow, bailliePSW } from '@tktb-tess/util-fns';
|
|
17
|
-
|
|
18
|
-
const ans = modPow(2n, 16n, 17n);
|
|
19
|
-
console.log(ans); // 1n
|
|
20
|
-
|
|
21
|
-
// Baillie-PSW primality test
|
|
22
|
-
console.log(bailliePSW(2n)); // true
|
|
23
|
-
console.log(bailliePSW(4n)): // false
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### CDN
|
|
28
|
-
|
|
29
|
-
You can also use it via CDN such as jsDelivr.
|
|
30
|
-
|
|
31
|
-
```html
|
|
32
|
-
<!-- You can import it as a global variable -->
|
|
33
|
-
<script src="https://cdn.jsdelivr.net/npm/@tktb-tess/util-fns@0.10.0/dist/bundle.min.js"></script>
|
|
34
|
-
<script type="module">
|
|
35
|
-
const { modPow } = UtilFns;
|
|
36
|
-
// ...
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<!-- or as an ES Module -->
|
|
40
|
-
<script type="module">
|
|
41
|
-
import { modPow } from 'https://cdn.jsdelivr.net/npm/@tktb-tess/util-fns@0.10.0/+esm';
|
|
42
|
-
// ...
|
|
43
|
-
</script>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|