@thi.ng/hex 2.1.9 → 2.2.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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2022-08-01T14:53:59Z
3
+ - **Last updated**: 2022-10-03T16:07:55Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ## [2.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/hex@2.2.0) (2022-09-21)
13
+
14
+ #### 🚀 Features
15
+
16
+ - add U64BIG ([06bcf05](https://github.com/thi-ng/umbrella/commit/06bcf05))
17
+
12
18
  ## [2.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/hex@2.1.0) (2021-11-17)
13
19
 
14
20
  #### 🚀 Features
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <!-- This file is generated - DO NOT EDIT! -->
2
2
 
3
- # ![hex](https://media.thi.ng/umbrella/banners/thing-hex.svg?ec10b9fc)
3
+ # ![hex](https://media.thi.ng/umbrella/banners-20220914/thing-hex.svg?acd0a87c)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@thi.ng/hex.svg)](https://www.npmjs.com/package/@thi.ng/hex)
6
6
  ![npm downloads](https://img.shields.io/npm/dm/@thi.ng/hex.svg)
@@ -10,8 +10,8 @@ This project is part of the
10
10
  [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
11
11
 
12
12
  - [About](#about)
13
- - [Status](#status)
14
- - [Related packages](#related-packages)
13
+ - [Status](#status)
14
+ - [Related packages](#related-packages)
15
15
  - [Installation](#installation)
16
16
  - [Dependencies](#dependencies)
17
17
  - [API](#api)
@@ -22,13 +22,13 @@ This project is part of the
22
22
 
23
23
  Hex string formatters for 4/8/16/24/32/48/64bit words.
24
24
 
25
- ### Status
25
+ ## Status
26
26
 
27
27
  **STABLE** - used in production
28
28
 
29
29
  [Search or submit any issues for this package](https://github.com/thi-ng/umbrella/issues?q=%5Bhex%5D+in%3Atitle)
30
30
 
31
- ### Related packages
31
+ ## Related packages
32
32
 
33
33
  - [@thi.ng/base-n](https://github.com/thi-ng/umbrella/tree/develop/packages/base-n) - Arbitrary base-n conversions w/ presets for base16/32/36/58/62/64/85, support for arrays & bigints
34
34
 
@@ -55,7 +55,7 @@ node --experimental-repl-await
55
55
  > const hex = await import("@thi.ng/hex");
56
56
  ```
57
57
 
58
- Package sizes (gzipped, pre-treeshake): ESM: 370 bytes
58
+ Package sizes (gzipped, pre-treeshake): ESM: 405 bytes
59
59
 
60
60
  ## Dependencies
61
61
 
package/index.d.ts CHANGED
@@ -124,9 +124,17 @@ export declare const U48LE: (x: ArrayLike<number>, i: number) => string;
124
124
  * {@link U64BE} or {@link U64LE} for byte array based values (full 64bit range
125
125
  * supported). Alternatively, use `BigInt(x).toString(16)`.
126
126
  *
127
+ * Also see {@link U64BIG} for `bigint` version.
128
+ *
127
129
  * @param x -
128
130
  */
129
131
  export declare const U64: (x: number) => string;
132
+ /**
133
+ * Returns 64bit bigint as hex string.
134
+ *
135
+ * @param x
136
+ */
137
+ export declare const U64BIG: (x: bigint) => string;
130
138
  /**
131
139
  * Similar to {@link U64}, but takes the 64bit arg as 2x 32bit values.
132
140
  *
package/index.js CHANGED
@@ -125,9 +125,17 @@ export const U48LE = (x, i) => U16LE(x, i + 4) + U32LE(x, i);
125
125
  * {@link U64BE} or {@link U64LE} for byte array based values (full 64bit range
126
126
  * supported). Alternatively, use `BigInt(x).toString(16)`.
127
127
  *
128
+ * Also see {@link U64BIG} for `bigint` version.
129
+ *
128
130
  * @param x -
129
131
  */
130
132
  export const U64 = (x) => U64HL(x / P32, x % P32);
133
+ /**
134
+ * Returns 64bit bigint as hex string.
135
+ *
136
+ * @param x
137
+ */
138
+ export const U64BIG = (x) => U64HL(Number(x >> BigInt(32)), Number(x & BigInt(P32 - 1)));
131
139
  /**
132
140
  * Similar to {@link U64}, but takes the 64bit arg as 2x 32bit values.
133
141
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/hex",
3
- "version": "2.1.9",
3
+ "version": "2.2.1",
4
4
  "description": "Hex string formatters for 4/8/16/24/32/48/64bit words",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -34,12 +34,12 @@
34
34
  "test": "testament test"
35
35
  },
36
36
  "devDependencies": {
37
- "@microsoft/api-extractor": "^7.25.0",
38
- "@thi.ng/testament": "^0.2.10",
37
+ "@microsoft/api-extractor": "^7.31.1",
38
+ "@thi.ng/testament": "^0.3.1",
39
39
  "rimraf": "^3.0.2",
40
40
  "tools": "^0.0.1",
41
41
  "typedoc": "^0.22.17",
42
- "typescript": "^4.7.4"
42
+ "typescript": "^4.8.3"
43
43
  },
44
44
  "keywords": [
45
45
  "binary",
@@ -69,5 +69,5 @@
69
69
  ],
70
70
  "year": 2020
71
71
  },
72
- "gitHead": "976ccd698cedaa60dcef2e69030a5eb98898cc4a\n"
72
+ "gitHead": "8600007d81a7dc92634a1d54e2c32b14ab30ba80\n"
73
73
  }