@thi.ng/transducers-binary 2.1.31 → 2.1.32
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/CHANGELOG.md +1 -1
- package/hex-dump.d.ts +9 -5
- package/package.json +6 -6
- package/random-bits.d.ts +5 -4
- package/random-bits.js +5 -4
- package/utf8.d.ts +3 -3
package/CHANGELOG.md
CHANGED
package/hex-dump.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { Transducer } from "@thi.ng/transducers";
|
|
2
2
|
import type { HexDumpOpts } from "./api.js";
|
|
3
3
|
/**
|
|
4
|
-
* Transforms bytes into a sequence of hexdump lines with configurable
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* are only produced once filled. If the input hasn't
|
|
8
|
-
* of `cols` bytes, the last line will be padded with zeroes.
|
|
4
|
+
* Transforms bytes into a sequence of hexdump lines with configurable number of
|
|
5
|
+
* `columns` and `address` offset. Uses
|
|
6
|
+
* [`partition()`](https://docs.thi.ng/umbrella/transducers/functions/partition.html)
|
|
7
|
+
* internally, so new lines are only produced once filled. If the input hasn't
|
|
8
|
+
* an exact multiple of `cols` bytes, the last line will be padded with zeroes.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* Also see alt implementation in
|
|
12
|
+
* [thi.ng/hex](https://docs.thi.ng/umbrella/hex/functions/hexdump.html)
|
|
9
13
|
*
|
|
10
14
|
* @example
|
|
11
15
|
* ```ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/transducers-binary",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.32",
|
|
4
4
|
"description": "Binary data related transducers & reducers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/binary": "^3.3.
|
|
38
|
-
"@thi.ng/compose": "^2.1.
|
|
37
|
+
"@thi.ng/binary": "^3.3.14",
|
|
38
|
+
"@thi.ng/compose": "^2.1.22",
|
|
39
39
|
"@thi.ng/errors": "^2.2.6",
|
|
40
40
|
"@thi.ng/hex": "^2.3.2",
|
|
41
|
-
"@thi.ng/random": "^3.3.
|
|
42
|
-
"@thi.ng/transducers": "^8.3.
|
|
41
|
+
"@thi.ng/random": "^3.3.19",
|
|
42
|
+
"@thi.ng/transducers": "^8.3.27"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@microsoft/api-extractor": "^7.33.7",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
],
|
|
113
113
|
"year": 2018
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
|
|
116
116
|
}
|
package/random-bits.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { IRandom } from "@thi.ng/random";
|
|
2
2
|
/**
|
|
3
|
-
* Returns an iterator of random bits, with 1's occurring w/ given
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Returns an iterator of random bits, with 1's occurring w/ given probability
|
|
4
|
+
* `prob` (in the [0,1] interval). If `num` is given, only that many bits will
|
|
5
|
+
* be produced.
|
|
6
6
|
*
|
|
7
7
|
* By default, uses system PRNG, but a custom
|
|
8
|
-
*
|
|
8
|
+
* [`IRandom`](https://docs.thi.ng/umbrella/random/interfaces/IRandom.html) impl
|
|
9
|
+
* can be provided via `rnd` arg.
|
|
9
10
|
*
|
|
10
11
|
* @param prob -
|
|
11
12
|
* @param num -
|
package/random-bits.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { SYSTEM } from "@thi.ng/random/system";
|
|
2
2
|
import { repeatedly } from "@thi.ng/transducers/repeatedly";
|
|
3
3
|
/**
|
|
4
|
-
* Returns an iterator of random bits, with 1's occurring w/ given
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Returns an iterator of random bits, with 1's occurring w/ given probability
|
|
5
|
+
* `prob` (in the [0,1] interval). If `num` is given, only that many bits will
|
|
6
|
+
* be produced.
|
|
7
7
|
*
|
|
8
8
|
* By default, uses system PRNG, but a custom
|
|
9
|
-
*
|
|
9
|
+
* [`IRandom`](https://docs.thi.ng/umbrella/random/interfaces/IRandom.html) impl
|
|
10
|
+
* can be provided via `rnd` arg.
|
|
10
11
|
*
|
|
11
12
|
* @param prob -
|
|
12
13
|
* @param num -
|
package/utf8.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { Transducer } from "@thi.ng/transducers";
|
|
2
2
|
/**
|
|
3
|
-
* Transducer which decodes a byte input sequence into UTF-8 characters.
|
|
4
|
-
*
|
|
3
|
+
* Transducer which decodes a byte input sequence into UTF-8 characters. Also
|
|
4
|
+
* see {@link utf8Encode} for reverse transformation.
|
|
5
5
|
*/
|
|
6
6
|
export declare function utf8Decode(): Transducer<number, string>;
|
|
7
7
|
export declare function utf8Decode(src: Iterable<number>): string;
|
|
8
8
|
/**
|
|
9
9
|
* Transducer which encodes UTF-8 characters into a byte sequence.
|
|
10
10
|
*
|
|
11
|
-
* Also see {@link
|
|
11
|
+
* Also see {@link utf8Decode} for reverse transformation.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts
|