@cbortech/cbor 0.25.2 → 0.25.3

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.
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Hex codec helpers shared by the CDN serializer, parser, and extensions.
3
+ *
4
+ * Native `Uint8Array.prototype.toHex` is the fastest option at every size, so
5
+ * it is used whenever available. Native `Uint8Array.fromHex` carries a fixed
6
+ * ~300–400 ns argument-validation overhead per call (measured on Node 25/26),
7
+ * which makes a lookup-table loop 5–6× faster for small payloads such as
8
+ * UUIDs; native only wins from ~128 bytes up. `hexToBytes` therefore switches
9
+ * implementations on input length.
10
+ */
11
+ /** Encode bytes as lowercase hex. */
12
+ export declare function bytesToHex(bytes: Uint8Array): string;
13
+ /**
14
+ * Decode a hex string to bytes.
15
+ *
16
+ * Throws SyntaxError on odd-length input or non-hex characters (the native
17
+ * fromHex path throws its own SyntaxError with a different message).
18
+ */
19
+ export declare function hexToBytes(hex: string): Uint8Array;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cbortech/cbor",
3
- "version": "0.25.2",
3
+ "version": "0.25.3",
4
4
  "description": "Convert between CBOR, CDN, and JavaScript values",
5
5
  "keywords": [
6
6
  "cbor",
@@ -91,7 +91,7 @@
91
91
  "@vitest/ui": "^4.1.8",
92
92
  "cross-env": "^10.1.0",
93
93
  "playwright": "^1.60.0",
94
- "prettier": "^3.8.3",
94
+ "prettier": "^3.8.4",
95
95
  "typescript": "^5.9.3",
96
96
  "vite": "^8.0.16",
97
97
  "vite-plugin-dts": "^4.5.4",