@mitre/hdf-utilities 3.7.2 → 3.8.0-next.42533588944.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 CHANGED
@@ -100,6 +100,9 @@ import { sha256, sha512, generateHash, hashObject, verifyHash } from '@mitre/hdf
100
100
  const hash = await sha256('content to hash');
101
101
  console.log(hash); // hex-encoded hash
102
102
 
103
+ // Raw bytes hash as they are; text is hashed as its UTF-8 bytes
104
+ const fileHash = await sha256(new Uint8Array([0x61, 0x62, 0x63]));
105
+
103
106
  // Hash with custom options
104
107
  const customHash = await generateHash('data', {
105
108
  algorithm: 'sha512',
@@ -1,5 +1,4 @@
1
1
  import { extractColumn, findRows } from "../object/index.js";
2
- //#region src/csv/index.d.ts
3
2
  /**
4
3
  * Options for parsing CSV
5
4
  */
@@ -97,6 +96,5 @@ export declare function sanitizeCsvArray(values: unknown[]): string[];
97
96
  * @returns New object with sanitized values
98
97
  */
99
98
  export declare function sanitizeCsvObject<T extends Record<string, unknown>>(obj: T): Record<string, string>;
100
- //#endregion
101
99
  export { extractColumn as extractCsvColumn, findRows as findCsvRows };
102
100
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/csv/index.ts"],"mappings":";;;;;iBAkBiB;EACf;EACA;EACA,mBAAmB,gBAAgB;EACnC;EACA;EACA;;;;;iBAMe;EACf;EACA;EACA;EACA;;;;;;;;;wBAwEc,SAAS,IAAI,yBAC3B,aACA,UAAU,QAAQ,mBACjB;;;;;;;;wBAoDa,cACd,aACA,UAAU,QAAQ;;;;;;;;;;;wBAiCJ,SAAS,IAAI,yBAC3B,MAAM,KACN,UAAU,QAAQ;EAAqB;;;;;;;;;;;;wBA6GzB,cACd,kBACA,UAAU,QAAQ;EAAqB;;;;;;;wBA4BzB,WAAW;;;;;;;;;;;;;;;wBA+BX,iBAAiB;;;;;;;wBAcjB,iBAAiB;;;;;;;wBAUjB,kBAAkB,UAAU,yBAC1C,KAAK,IACJ"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/csv/index.ts"],"mappings":";;;;iBAkBiB;EACf;EACA;EACA,mBAAmB,gBAAgB;EACnC;EACA;EACA;;;;;iBAMe;EACf;EACA;EACA;EACA;;;;;;;;;wBAwEc,SAAS,IAAI,yBAC3B,aACA,UAAU,QAAQ,mBACjB;;;;;;;;wBAoDa,cACd,aACA,UAAU,QAAQ;;;;;;;;;;;wBAiCJ,SAAS,IAAI,yBAC3B,MAAM,KACN,UAAU,QAAQ;EAAqB;;;;;;;;;;;;wBA6GzB,cACd,kBACA,UAAU,QAAQ;EAAqB;;;;;;;wBA4BzB,WAAW;;;;;;;;;;;;;;;wBA+BX,iBAAiB;;;;;;;wBAcjB,iBAAiB;;;;;;;wBAUjB,kBAAkB,UAAU,yBAC1C,KAAK,IACJ"}
package/dist/csv/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { extractColumn, findRows } from "../object/index.js";
2
2
  import { dsvFormat } from "d3-dsv";
3
- //#region src/csv/index.ts
3
+ // src/csv/index.ts
4
4
  /**
5
5
  * CSV parsing and generation utilities using d3-dsv
6
6
  *
@@ -271,7 +271,6 @@ function sanitizeCsvObject(obj) {
271
271
  for (const [key, value] of Object.entries(obj)) sanitized[key] = sanitizeCsvValue(value);
272
272
  return sanitized;
273
273
  }
274
- //#endregion
275
274
  export { buildCsv, buildCsvArray, extractColumn as extractCsvColumn, findRows as findCsvRows, isValidCsv, parseCsv, parseCsvArray, sanitizeCsvArray, sanitizeCsvObject, sanitizeCsvValue };
276
275
 
277
276
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,3 @@
1
- //#region src/hash/index.d.ts
2
1
  /**
3
2
  * Hash utilities for HDF content
4
3
  * Provides cryptographic hashing functions for content identification and integrity verification
@@ -7,11 +6,15 @@
7
6
  /**
8
7
  * Supported hash algorithms
9
8
  */
10
- export type HashAlgorithm = 'sha256' | 'sha512';
9
+ export type HashAlgorithm = 'sha256' | 'sha384' | 'sha512';
11
10
  /**
12
11
  * Supported output encodings
13
12
  */
14
13
  export type HashEncoding = 'hex' | 'base64';
14
+ /**
15
+ * Data that can be hashed: text, hashed as its UTF-8 bytes, or raw bytes
16
+ */
17
+ export type HashInput = string | Uint8Array;
15
18
  /**
16
19
  * Options for hash generation
17
20
  */
@@ -24,7 +27,7 @@ export interface HashOptions {
24
27
  /**
25
28
  * Generate a hash of the given data
26
29
  *
27
- * @param data - String data to hash
30
+ * @param data - Text or bytes to hash
28
31
  * @param options - Hash generation options
29
32
  * @returns Hex-encoded hash string
30
33
  *
@@ -34,11 +37,11 @@ export interface HashOptions {
34
37
  * // Returns: 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9'
35
38
  * ```
36
39
  */
37
- export declare function generateHash(data: string, options?: HashOptions): Promise<string>;
40
+ export declare function generateHash(data: HashInput, options?: HashOptions): Promise<string>;
38
41
  /**
39
42
  * Generate a SHA-256 hash (recommended for most use cases)
40
43
  *
41
- * @param data - String data to hash
44
+ * @param data - Text or bytes to hash
42
45
  * @returns Hex-encoded SHA-256 hash
43
46
  *
44
47
  * @example
@@ -47,11 +50,11 @@ export declare function generateHash(data: string, options?: HashOptions): Promi
47
50
  * // Returns: 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9'
48
51
  * ```
49
52
  */
50
- export declare function sha256(data: string): Promise<string>;
53
+ export declare function sha256(data: HashInput): Promise<string>;
51
54
  /**
52
55
  * Generate a SHA-512 hash (enhanced security for sensitive data)
53
56
  *
54
- * @param data - String data to hash
57
+ * @param data - Text or bytes to hash
55
58
  * @returns Hex-encoded SHA-512 hash
56
59
  *
57
60
  * @example
@@ -60,7 +63,7 @@ export declare function sha256(data: string): Promise<string>;
60
63
  * // Returns: '309ecc489c12d6eb4cc40f50c902f2b4d0ed77ee511a7c7a9bcd3ca86d4cd86f989dd35bc5ff499670da34255b45b0cfd830e81f605dcf7dc5542e93ae9cd76f'
61
64
  * ```
62
65
  */
63
- export declare function sha512(data: string): Promise<string>;
66
+ export declare function sha512(data: HashInput): Promise<string>;
64
67
  /**
65
68
  * Generate a hash of an object by stringifying it first
66
69
  * Useful for hashing HDF control objects or other structured data
@@ -80,7 +83,7 @@ export declare function hashObject(obj: unknown, options?: HashOptions): Promise
80
83
  /**
81
84
  * Verify that data matches a given hash
82
85
  *
83
- * @param data - String data to verify
86
+ * @param data - Text or bytes to verify
84
87
  * @param expectedHash - Expected hash value
85
88
  * @param options - Hash generation options (must match hash generation)
86
89
  * @returns True if data matches the hash
@@ -92,6 +95,5 @@ export declare function hashObject(obj: unknown, options?: HashOptions): Promise
92
95
  * const isValid = await verifyHash(data, hash); // true
93
96
  * ```
94
97
  */
95
- export declare function verifyHash(data: string, expectedHash: string, options?: HashOptions): Promise<boolean>;
96
- //#endregion
98
+ export declare function verifyHash(data: HashInput, expectedHash: string, options?: HashOptions): Promise<boolean>;
97
99
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/hash/index.ts"],"mappings":";;;;;;;;;YASY;;;;YAKA;;;;iBAKK;;EAEf,YAAY;;EAEZ,WAAW;;;;;;;;;;;;;;;wBA0CS,aAAa,cAAc,UAAS,cAAmB;;;;;;;;;;;;;wBAoBvD,OAAO,eAAe;;;;;;;;;;;;;wBAgBtB,OAAO,eAAe;;;;;;;;;;;;;;;;wBAmBtB,WAAW,cAAc,UAAS,cAAmB;;;;;;;;;;;;;;;;wBAqBrD,WACpB,cACA,sBACA,UAAS,cACR"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/hash/index.ts"],"mappings":";;;;;;;;YASY;;;;YAKA;;;;YAKA,qBAAqB;;;;iBAKhB;;EAEf,YAAY;;EAEZ,WAAW;;;;;;;;;;;;;;;wBAuDS,aAAa,MAAM,WAAW,UAAS,cAAmB;;;;;;;;;;;;;wBAmB1D,OAAO,MAAM,YAAY;;;;;;;;;;;;;wBAgBzB,OAAO,MAAM,YAAY;;;;;;;;;;;;;;;;wBAmBzB,WAAW,cAAc,UAAS,cAAmB;;;;;;;;;;;;;;;;wBAqBrD,WACpB,MAAM,WACN,sBACA,UAAS,cACR"}
@@ -1,9 +1,18 @@
1
- //#region src/hash/index.ts
1
+ // src/hash/index.ts
2
2
  /** Map our algorithm names to Web Crypto algorithm identifiers */
3
3
  const ALGORITHM_MAP = {
4
4
  sha256: "SHA-256",
5
+ sha384: "SHA-384",
5
6
  sha512: "SHA-512"
6
7
  };
8
+ /** Web Crypto refuses a view over shared memory, so such a view is copied first. */
9
+ function digestInput(data) {
10
+ if (typeof data === "string") return new TextEncoder().encode(data);
11
+ return isArrayBufferBacked(data) ? data : new Uint8Array(data);
12
+ }
13
+ function isArrayBufferBacked(bytes) {
14
+ return bytes.buffer instanceof ArrayBuffer;
15
+ }
7
16
  /** Convert an ArrayBuffer to a hex string */
8
17
  function bufferToHex(buffer) {
9
18
  const bytes = new Uint8Array(buffer);
@@ -21,7 +30,7 @@ function bufferToBase64(buffer) {
21
30
  /**
22
31
  * Generate a hash of the given data
23
32
  *
24
- * @param data - String data to hash
33
+ * @param data - Text or bytes to hash
25
34
  * @param options - Hash generation options
26
35
  * @returns Hex-encoded hash string
27
36
  *
@@ -34,14 +43,13 @@ function bufferToBase64(buffer) {
34
43
  async function generateHash(data, options = {}) {
35
44
  const { algorithm = "sha256", encoding = "hex" } = options;
36
45
  const webAlgorithm = ALGORITHM_MAP[algorithm];
37
- const encoded = new TextEncoder().encode(data);
38
- const hashBuffer = await globalThis.crypto.subtle.digest(webAlgorithm, encoded);
46
+ const hashBuffer = await globalThis.crypto.subtle.digest(webAlgorithm, digestInput(data));
39
47
  return encoding === "base64" ? bufferToBase64(hashBuffer) : bufferToHex(hashBuffer);
40
48
  }
41
49
  /**
42
50
  * Generate a SHA-256 hash (recommended for most use cases)
43
51
  *
44
- * @param data - String data to hash
52
+ * @param data - Text or bytes to hash
45
53
  * @returns Hex-encoded SHA-256 hash
46
54
  *
47
55
  * @example
@@ -56,7 +64,7 @@ async function sha256(data) {
56
64
  /**
57
65
  * Generate a SHA-512 hash (enhanced security for sensitive data)
58
66
  *
59
- * @param data - String data to hash
67
+ * @param data - Text or bytes to hash
60
68
  * @returns Hex-encoded SHA-512 hash
61
69
  *
62
70
  * @example
@@ -89,7 +97,7 @@ async function hashObject(obj, options = {}) {
89
97
  /**
90
98
  * Verify that data matches a given hash
91
99
  *
92
- * @param data - String data to verify
100
+ * @param data - Text or bytes to verify
93
101
  * @param expectedHash - Expected hash value
94
102
  * @param options - Hash generation options (must match hash generation)
95
103
  * @returns True if data matches the hash
@@ -104,7 +112,6 @@ async function hashObject(obj, options = {}) {
104
112
  async function verifyHash(data, expectedHash, options = {}) {
105
113
  return await generateHash(data, options) === expectedHash;
106
114
  }
107
- //#endregion
108
115
  export { generateHash, hashObject, sha256, sha512, verifyHash };
109
116
 
110
117
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/hash/index.ts"],"sourcesContent":["/**\n * Hash utilities for HDF content\n * Provides cryptographic hashing functions for content identification and integrity verification\n * Uses the Web Crypto API (globalThis.crypto.subtle) for browser and Node.js compatibility\n */\n\n/**\n * Supported hash algorithms\n */\nexport type HashAlgorithm = 'sha256' | 'sha512';\n\n/**\n * Supported output encodings\n */\nexport type HashEncoding = 'hex' | 'base64';\n\n/**\n * Options for hash generation\n */\nexport interface HashOptions {\n /** Hash algorithm (default: 'sha256') */\n algorithm?: HashAlgorithm;\n /** Output encoding (default: 'hex') */\n encoding?: HashEncoding;\n}\n\n/** Map our algorithm names to Web Crypto algorithm identifiers */\nconst ALGORITHM_MAP: Record<HashAlgorithm, string> = {\n sha256: 'SHA-256',\n sha512: 'SHA-512',\n};\n\n/** Convert an ArrayBuffer to a hex string */\nfunction bufferToHex(buffer: ArrayBuffer): string {\n const bytes = new Uint8Array(buffer);\n let hex = '';\n for (const b of bytes) {\n hex += b.toString(16).padStart(2, '0');\n }\n return hex;\n}\n\n/** Convert an ArrayBuffer to a base64 string */\nfunction bufferToBase64(buffer: ArrayBuffer): string {\n const bytes = new Uint8Array(buffer);\n let binary = '';\n for (const b of bytes) {\n binary += String.fromCharCode(b);\n }\n return btoa(binary);\n}\n\n/**\n * Generate a hash of the given data\n *\n * @param data - String data to hash\n * @param options - Hash generation options\n * @returns Hex-encoded hash string\n *\n * @example\n * ```typescript\n * const hash = await generateHash('hello world');\n * // Returns: 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9'\n * ```\n */\nexport async function generateHash(data: string, options: HashOptions = {}): Promise<string> {\n const { algorithm = 'sha256', encoding = 'hex' } = options;\n const webAlgorithm = ALGORITHM_MAP[algorithm];\n const encoded = new TextEncoder().encode(data);\n const hashBuffer = await globalThis.crypto.subtle.digest(webAlgorithm, encoded);\n return encoding === 'base64' ? bufferToBase64(hashBuffer) : bufferToHex(hashBuffer);\n}\n\n/**\n * Generate a SHA-256 hash (recommended for most use cases)\n *\n * @param data - String data to hash\n * @returns Hex-encoded SHA-256 hash\n *\n * @example\n * ```typescript\n * const hash = await sha256('hello world');\n * // Returns: 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9'\n * ```\n */\nexport async function sha256(data: string): Promise<string> {\n return generateHash(data, { algorithm: 'sha256' });\n}\n\n/**\n * Generate a SHA-512 hash (enhanced security for sensitive data)\n *\n * @param data - String data to hash\n * @returns Hex-encoded SHA-512 hash\n *\n * @example\n * ```typescript\n * const hash = await sha512('hello world');\n * // Returns: '309ecc489c12d6eb4cc40f50c902f2b4d0ed77ee511a7c7a9bcd3ca86d4cd86f989dd35bc5ff499670da34255b45b0cfd830e81f605dcf7dc5542e93ae9cd76f'\n * ```\n */\nexport async function sha512(data: string): Promise<string> {\n return generateHash(data, { algorithm: 'sha512' });\n}\n\n/**\n * Generate a hash of an object by stringifying it first\n * Useful for hashing HDF control objects or other structured data\n *\n * @param obj - Object to hash\n * @param options - Hash generation options\n * @returns Hex-encoded hash string\n *\n * @example\n * ```typescript\n * const control = { id: 'V-12345', title: 'Test Control' };\n * const hash = await hashObject(control);\n * // Returns hash of the JSON-stringified object\n * ```\n */\nexport async function hashObject(obj: unknown, options: HashOptions = {}): Promise<string> {\n // JSON.stringify returns undefined for undefined, so handle it explicitly\n const stringified = obj === undefined ? 'undefined' : JSON.stringify(obj);\n return generateHash(stringified, options);\n}\n\n/**\n * Verify that data matches a given hash\n *\n * @param data - String data to verify\n * @param expectedHash - Expected hash value\n * @param options - Hash generation options (must match hash generation)\n * @returns True if data matches the hash\n *\n * @example\n * ```typescript\n * const data = 'hello world';\n * const hash = await sha256(data);\n * const isValid = await verifyHash(data, hash); // true\n * ```\n */\nexport async function verifyHash(\n data: string,\n expectedHash: string,\n options: HashOptions = {}\n): Promise<boolean> {\n const actualHash = await generateHash(data, options);\n return actualHash === expectedHash;\n}\n"],"mappings":";;AA2BA,MAAM,gBAA+C;CACnD,QAAQ;CACR,QAAQ;AACV;;AAGA,SAAS,YAAY,QAA6B;CAChD,MAAM,QAAQ,IAAI,WAAW,MAAM;CACnC,IAAI,MAAM;CACV,KAAK,MAAM,KAAK,OACd,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;CAEvC,OAAO;AACT;;AAGA,SAAS,eAAe,QAA6B;CACnD,MAAM,QAAQ,IAAI,WAAW,MAAM;CACnC,IAAI,SAAS;CACb,KAAK,MAAM,KAAK,OACd,UAAU,OAAO,aAAa,CAAC;CAEjC,OAAO,KAAK,MAAM;AACpB;;;;;;;;;;;;;;AAeA,eAAsB,aAAa,MAAc,UAAuB,CAAC,GAAoB;CAC3F,MAAM,EAAE,YAAY,UAAU,WAAW,UAAU;CACnD,MAAM,eAAe,cAAc;CACnC,MAAM,UAAU,IAAI,YAAY,CAAC,CAAC,OAAO,IAAI;CAC7C,MAAM,aAAa,MAAM,WAAW,OAAO,OAAO,OAAO,cAAc,OAAO;CAC9E,OAAO,aAAa,WAAW,eAAe,UAAU,IAAI,YAAY,UAAU;AACpF;;;;;;;;;;;;;AAcA,eAAsB,OAAO,MAA+B;CAC1D,OAAO,aAAa,MAAM,EAAE,WAAW,SAAS,CAAC;AACnD;;;;;;;;;;;;;AAcA,eAAsB,OAAO,MAA+B;CAC1D,OAAO,aAAa,MAAM,EAAE,WAAW,SAAS,CAAC;AACnD;;;;;;;;;;;;;;;;AAiBA,eAAsB,WAAW,KAAc,UAAuB,CAAC,GAAoB;CAGzF,OAAO,aADa,QAAQ,KAAA,IAAY,cAAc,KAAK,UAAU,GAAG,GACvC,OAAO;AAC1C;;;;;;;;;;;;;;;;AAiBA,eAAsB,WACpB,MACA,cACA,UAAuB,CAAC,GACN;CAElB,OAAO,MADkB,aAAa,MAAM,OAAO,MAC7B;AACxB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/hash/index.ts"],"sourcesContent":["/**\n * Hash utilities for HDF content\n * Provides cryptographic hashing functions for content identification and integrity verification\n * Uses the Web Crypto API (globalThis.crypto.subtle) for browser and Node.js compatibility\n */\n\n/**\n * Supported hash algorithms\n */\nexport type HashAlgorithm = 'sha256' | 'sha384' | 'sha512';\n\n/**\n * Supported output encodings\n */\nexport type HashEncoding = 'hex' | 'base64';\n\n/**\n * Data that can be hashed: text, hashed as its UTF-8 bytes, or raw bytes\n */\nexport type HashInput = string | Uint8Array;\n\n/**\n * Options for hash generation\n */\nexport interface HashOptions {\n /** Hash algorithm (default: 'sha256') */\n algorithm?: HashAlgorithm;\n /** Output encoding (default: 'hex') */\n encoding?: HashEncoding;\n}\n\n/** Map our algorithm names to Web Crypto algorithm identifiers */\nconst ALGORITHM_MAP: Record<HashAlgorithm, string> = {\n sha256: 'SHA-256',\n sha384: 'SHA-384',\n sha512: 'SHA-512',\n};\n\n/** Web Crypto refuses a view over shared memory, so such a view is copied first. */\nfunction digestInput(data: HashInput): Uint8Array<ArrayBuffer> {\n if (typeof data === 'string') {\n return new TextEncoder().encode(data);\n }\n return isArrayBufferBacked(data) ? data : new Uint8Array(data);\n}\n\nfunction isArrayBufferBacked(bytes: Uint8Array): bytes is Uint8Array<ArrayBuffer> {\n return bytes.buffer instanceof ArrayBuffer;\n}\n\n/** Convert an ArrayBuffer to a hex string */\nfunction bufferToHex(buffer: ArrayBuffer): string {\n const bytes = new Uint8Array(buffer);\n let hex = '';\n for (const b of bytes) {\n hex += b.toString(16).padStart(2, '0');\n }\n return hex;\n}\n\n/** Convert an ArrayBuffer to a base64 string */\nfunction bufferToBase64(buffer: ArrayBuffer): string {\n const bytes = new Uint8Array(buffer);\n let binary = '';\n for (const b of bytes) {\n binary += String.fromCharCode(b);\n }\n return btoa(binary);\n}\n\n/**\n * Generate a hash of the given data\n *\n * @param data - Text or bytes to hash\n * @param options - Hash generation options\n * @returns Hex-encoded hash string\n *\n * @example\n * ```typescript\n * const hash = await generateHash('hello world');\n * // Returns: 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9'\n * ```\n */\nexport async function generateHash(data: HashInput, options: HashOptions = {}): Promise<string> {\n const { algorithm = 'sha256', encoding = 'hex' } = options;\n const webAlgorithm = ALGORITHM_MAP[algorithm];\n const hashBuffer = await globalThis.crypto.subtle.digest(webAlgorithm, digestInput(data));\n return encoding === 'base64' ? bufferToBase64(hashBuffer) : bufferToHex(hashBuffer);\n}\n\n/**\n * Generate a SHA-256 hash (recommended for most use cases)\n *\n * @param data - Text or bytes to hash\n * @returns Hex-encoded SHA-256 hash\n *\n * @example\n * ```typescript\n * const hash = await sha256('hello world');\n * // Returns: 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9'\n * ```\n */\nexport async function sha256(data: HashInput): Promise<string> {\n return generateHash(data, { algorithm: 'sha256' });\n}\n\n/**\n * Generate a SHA-512 hash (enhanced security for sensitive data)\n *\n * @param data - Text or bytes to hash\n * @returns Hex-encoded SHA-512 hash\n *\n * @example\n * ```typescript\n * const hash = await sha512('hello world');\n * // Returns: '309ecc489c12d6eb4cc40f50c902f2b4d0ed77ee511a7c7a9bcd3ca86d4cd86f989dd35bc5ff499670da34255b45b0cfd830e81f605dcf7dc5542e93ae9cd76f'\n * ```\n */\nexport async function sha512(data: HashInput): Promise<string> {\n return generateHash(data, { algorithm: 'sha512' });\n}\n\n/**\n * Generate a hash of an object by stringifying it first\n * Useful for hashing HDF control objects or other structured data\n *\n * @param obj - Object to hash\n * @param options - Hash generation options\n * @returns Hex-encoded hash string\n *\n * @example\n * ```typescript\n * const control = { id: 'V-12345', title: 'Test Control' };\n * const hash = await hashObject(control);\n * // Returns hash of the JSON-stringified object\n * ```\n */\nexport async function hashObject(obj: unknown, options: HashOptions = {}): Promise<string> {\n // JSON.stringify returns undefined for undefined, so handle it explicitly\n const stringified = obj === undefined ? 'undefined' : JSON.stringify(obj);\n return generateHash(stringified, options);\n}\n\n/**\n * Verify that data matches a given hash\n *\n * @param data - Text or bytes to verify\n * @param expectedHash - Expected hash value\n * @param options - Hash generation options (must match hash generation)\n * @returns True if data matches the hash\n *\n * @example\n * ```typescript\n * const data = 'hello world';\n * const hash = await sha256(data);\n * const isValid = await verifyHash(data, hash); // true\n * ```\n */\nexport async function verifyHash(\n data: HashInput,\n expectedHash: string,\n options: HashOptions = {}\n): Promise<boolean> {\n const actualHash = await generateHash(data, options);\n return actualHash === expectedHash;\n}\n"],"mappings":";;AAgCA,MAAM,gBAA+C;CACnD,QAAQ;CACR,QAAQ;CACR,QAAQ;AACV;;AAGA,SAAS,YAAY,MAA0C;CAC7D,IAAI,OAAO,SAAS,UAClB,OAAO,IAAI,YAAY,CAAC,CAAC,OAAO,IAAI;CAEtC,OAAO,oBAAoB,IAAI,IAAI,OAAO,IAAI,WAAW,IAAI;AAC/D;AAEA,SAAS,oBAAoB,OAAqD;CAChF,OAAO,MAAM,kBAAkB;AACjC;;AAGA,SAAS,YAAY,QAA6B;CAChD,MAAM,QAAQ,IAAI,WAAW,MAAM;CACnC,IAAI,MAAM;CACV,KAAK,MAAM,KAAK,OACd,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;CAEvC,OAAO;AACT;;AAGA,SAAS,eAAe,QAA6B;CACnD,MAAM,QAAQ,IAAI,WAAW,MAAM;CACnC,IAAI,SAAS;CACb,KAAK,MAAM,KAAK,OACd,UAAU,OAAO,aAAa,CAAC;CAEjC,OAAO,KAAK,MAAM;AACpB;;;;;;;;;;;;;;AAeA,eAAsB,aAAa,MAAiB,UAAuB,CAAC,GAAoB;CAC9F,MAAM,EAAE,YAAY,UAAU,WAAW,UAAU;CACnD,MAAM,eAAe,cAAc;CACnC,MAAM,aAAa,MAAM,WAAW,OAAO,OAAO,OAAO,cAAc,YAAY,IAAI,CAAC;CACxF,OAAO,aAAa,WAAW,eAAe,UAAU,IAAI,YAAY,UAAU;AACpF;;;;;;;;;;;;;AAcA,eAAsB,OAAO,MAAkC;CAC7D,OAAO,aAAa,MAAM,EAAE,WAAW,SAAS,CAAC;AACnD;;;;;;;;;;;;;AAcA,eAAsB,OAAO,MAAkC;CAC7D,OAAO,aAAa,MAAM,EAAE,WAAW,SAAS,CAAC;AACnD;;;;;;;;;;;;;;;;AAiBA,eAAsB,WAAW,KAAc,UAAuB,CAAC,GAAoB;CAGzF,OAAO,aADa,QAAQ,KAAA,IAAY,cAAc,KAAK,UAAU,GAAG,GACvC,OAAO;AAC1C;;;;;;;;;;;;;;;;AAiBA,eAAsB,WACpB,MACA,cACA,UAAuB,CAAC,GACN;CAElB,OAAO,MADkB,aAAa,MAAM,OAAO,MAC7B;AACxB"}
@@ -1,4 +1,3 @@
1
- //#region src/json/canonical.d.ts
2
1
  /**
3
2
  * Canonical JSON — the encoding HDF uses for content-addressed checksums, such
4
3
  * as the amendment chain's `previousChecksum`.
@@ -26,8 +25,6 @@
26
25
  declare function canonicalJson(value: unknown): string;
27
26
  /** Returns the hex-encoded SHA-256 of a value's canonical JSON encoding. */
28
27
  declare function canonicalChecksum(value: unknown): Promise<string>;
29
- //#endregion
30
- //#region src/json/index.d.ts
31
28
  /**
32
29
  * Options for JSON stringification
33
30
  */
@@ -78,6 +75,5 @@ declare function isValidJSON(input: unknown): boolean;
78
75
  * documented cross-language divergence, not something this helper can close.
79
76
  */
80
77
  declare function formatJsonNumber(value: number): string;
81
- //#endregion
82
78
  export { stringifyJSON as a, parseJSON as i, formatJsonNumber as n, canonicalChecksum as o, isValidJSON as r, canonicalJson as s, StringifyOptions as t };
83
- //# sourceMappingURL=index-i4P63h9e.d.ts.map
79
+ //# sourceMappingURL=index-CdhaEDAp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CdhaEDAp.d.ts","names":[],"sources":["../src/json/canonical.ts","../src/json/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;iBAkIgB,cAAc;;iBAKR,kBAAkB,iBAAiB;;;;UCjIxC;;EAEf;;EAEA;;;;;;;;iBASc,UAAU,aAAa,gBAAgB;;;;;;;;iBAuBvC,cAAc,gBAAgB,UAAS;;;;;;iBAkBvC,YAAY;;;;;;;;;;;;;;;;;;;;iBAoCZ,iBAAiB"}
package/dist/index.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  import { extractColumn, findRows, findValuesByKey } from "./object/index.js";
2
2
  import { CsvBuildOptions, CsvParseOptions, buildCsv, buildCsvArray, isValidCsv, parseCsv, parseCsvArray, sanitizeCsvArray, sanitizeCsvObject, sanitizeCsvValue } from "./csv/index.js";
3
- import { HashAlgorithm, HashEncoding, HashOptions, generateHash, hashObject, sha256, sha512, verifyHash } from "./hash/index.js";
4
- import { a as stringifyJSON, i as parseJSON, n as formatJsonNumber, o as canonicalChecksum, r as isValidJSON, s as canonicalJson, t as StringifyOptions } from "./index-i4P63h9e.js";
5
- import { buildXml, extractTextFromXml, isValidXml, isXmlChar, parseXml, parseXmlWithArrays, xmlSafeText } from "./xml/index.js";
3
+ import { HashAlgorithm, HashEncoding, HashInput, HashOptions, generateHash, hashObject, sha256, sha512, verifyHash } from "./hash/index.js";
4
+ import { a as stringifyJSON, i as parseJSON, n as formatJsonNumber, o as canonicalChecksum, r as isValidJSON, s as canonicalJson, t as StringifyOptions } from "./index-CdhaEDAp.js";
5
+ import { XmlPrologueDeclarations, buildXml, containsXmlDoctype, containsXmlEntityDeclarations, extractTextFromXml, inspectXmlPrologue, isValidXml, isXmlChar, parseXml, parseXmlWithArrays, xmlSafeText } from "./xml/index.js";
6
6
  import { absentIfGoZeroTime, encodeBase64Utf8, formatTimestamp, formatTimestampSeconds, isGoZeroTime, normalizeHdfTimestamps, parseTimestamp, replaceHtmlTags, stripHtml, trimUtcFraction } from "./string/index.js";
7
- //#region src/severity/index.d.ts
8
7
  /**
9
8
  * Severity-to-impact mapping utilities.
10
9
  *
@@ -82,8 +81,6 @@ export declare function cvssScoreToSeverity(score: number): 'none' | 'low' | 'me
82
81
  * marker so a defaulted impact stays distinguishable from a genuine medium.
83
82
  */
84
83
  export declare function isUnratedSeverity(severity?: string | null): boolean;
85
- //#endregion
86
- //#region src/status/index.d.ts
87
84
  /**
88
85
  * Canonical HDF result-status ordering and effective-status computation.
89
86
  *
@@ -187,8 +184,6 @@ export declare function governingImpactOverrideIndex(overrides: readonly StatusO
187
184
  * Parity: ComputeEffectiveImpact in go/status.go.
188
185
  */
189
186
  export declare function computeEffectiveImpact(input: EffectiveStatusInput, referenceTimestamp?: string): number;
190
- //#endregion
191
- //#region src/cvss/index.d.ts
192
187
  /**
193
188
  * CVSS vector parsing and validation utilities.
194
189
  *
@@ -276,8 +271,6 @@ export declare function cvss40MacroVector(vector: string): string;
276
271
  * metric value is out of the 4.0 enum.
277
272
  */
278
273
  export declare function computeCvss40Score(vector: string): CvssScore;
279
- //#endregion
280
- //#region src/cwe/index.d.ts
281
274
  /**
282
275
  * CWE identifier extraction — the TypeScript twin of hdf-utilities/go/cwe.go.
283
276
  *
@@ -293,8 +286,6 @@ export declare const CWE_PATTERN: RegExp;
293
286
  * names none. Parity: ExtractCWEIDs in go/cwe.go.
294
287
  */
295
288
  export declare function extractCWEIDs(text: string): string[];
296
- //#endregion
297
- //#region src/cpe/index.d.ts
298
289
  /**
299
290
  * CPE 2.3 URI parser for HDF converters.
300
291
  *
@@ -365,8 +356,6 @@ interface ParsedCpe {
365
356
  * ```
366
357
  */
367
358
  export declare function parseCpe(cpeUri: string): ParsedCpe | null;
368
- //#endregion
369
- //#region src/purl/index.d.ts
370
359
  /**
371
360
  * Package URL (PURL) parser for SBOM and CVE-scanner ingestion.
372
361
  *
@@ -421,8 +410,6 @@ interface ParsedPurl {
421
410
  * ```
422
411
  */
423
412
  export declare function parsePurl(purlStr: string): ParsedPurl | null;
424
- //#endregion
425
- //#region src/size/index.d.ts
426
413
  /** Default maximum input size (256 MB), matching the Go DefaultMaxInputSize. */
427
414
  export declare const DEFAULT_MAX_INPUT_SIZE: number;
428
415
  /**
@@ -443,6 +430,5 @@ export declare function resolveMaxInputSize(maxSize?: number): number;
443
430
  * string input, so it matches the Go []byte length for the same document.
444
431
  */
445
432
  export declare function validateInputSize(input: string | Uint8Array, maxSize?: number): void;
446
- //#endregion
447
- export { type CpePart, type CsvBuildOptions, type CsvParseOptions, type CvssScore, type CvssValidationResult, type EffectiveStatusInput, type HashAlgorithm, type HashEncoding, type HashOptions, type ParsedCpe, type ParsedCvssVector, type ParsedPurl, type StatusOverrideInput, type StatusSeverity, type StringifyOptions, absentIfGoZeroTime, buildCsv, buildCsvArray, buildXml, canonicalChecksum, canonicalJson, encodeBase64Utf8, extractColumn, extractColumn as extractCsvColumn, extractTextFromXml, findRows as findCsvRows, findRows, findValuesByKey as findJsonValues, findValuesByKey, findValuesByKey as findXmlValues, formatJsonNumber, formatTimestamp, formatTimestampSeconds, generateHash, hashObject, isGoZeroTime, isValidCsv, isValidJSON, isValidXml, isXmlChar, normalizeHdfTimestamps, parseCsv, parseCsvArray, parseJSON, parseTimestamp, parseXml, parseXmlWithArrays, replaceHtmlTags, sanitizeCsvArray, sanitizeCsvObject, sanitizeCsvValue, sha256, sha512, stringifyJSON, stripHtml, trimUtcFraction, verifyHash, xmlSafeText };
433
+ export { type CpePart, type CsvBuildOptions, type CsvParseOptions, type CvssScore, type CvssValidationResult, type EffectiveStatusInput, type HashAlgorithm, type HashEncoding, type HashInput, type HashOptions, type ParsedCpe, type ParsedCvssVector, type ParsedPurl, type StatusOverrideInput, type StatusSeverity, type StringifyOptions, type XmlPrologueDeclarations, absentIfGoZeroTime, buildCsv, buildCsvArray, buildXml, canonicalChecksum, canonicalJson, containsXmlDoctype, containsXmlEntityDeclarations, encodeBase64Utf8, extractColumn, extractColumn as extractCsvColumn, extractTextFromXml, findRows as findCsvRows, findRows, findValuesByKey as findJsonValues, findValuesByKey, findValuesByKey as findXmlValues, formatJsonNumber, formatTimestamp, formatTimestampSeconds, generateHash, hashObject, inspectXmlPrologue, isGoZeroTime, isValidCsv, isValidJSON, isValidXml, isXmlChar, normalizeHdfTimestamps, parseCsv, parseCsvArray, parseJSON, parseTimestamp, parseXml, parseXmlWithArrays, replaceHtmlTags, sanitizeCsvArray, sanitizeCsvObject, sanitizeCsvValue, sha256, sha512, stringifyJSON, stripHtml, trimUtcFraction, verifyHash, xmlSafeText };
448
434
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/severity/index.ts","../src/status/index.ts","../src/cvss/index.ts","../src/cwe/index.ts","../src/cpe/index.ts","../src/purl/index.ts","../src/size/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;wBAgCgB,iBAAiB;wBACjB,iBAAiB;wBACjB,iBAAiB;;;;;;;;;;wBAsBjB,4BACd,qCACA,SAAS,wBACT;;;;;;;;;wBAkBc,YAAY;;;;;;;wBAUZ,iBAAiB;wBACjB,iBAAiB;wBACjB,iBAAiB;;;;;;;;;;;;;;;;;;wBA2BjB,oBACd;;;;;;;;wBAsBc,kBAAkB;;;;;;;;;;;;qBC/HrB;;KASD,yBAAyB;;wBAMrB,WAAW;;;;;wBASX,YAAY;;;;;UAiBX;;EAEf;;EAEA;;EAEA;;;;;;EAMA;;;;;;;;wBAiBc,wBACd,oBAAoB,uBACpB,8BACC;;;;;;;;;wBAaa,uBACd,oBAAoB,uBACpB,WAAW,2BACX;;;;;;wBAmBc,6BACd,oBAAoB,uBACpB;;UAgBe;EACf;EACA;EACA,qBAAqB;;;;;;;;;;;;;;;wBAgBP,uBACd,OAAO,sBACP;;;;;;;;;;wBAuBc,6BACd,oBAAoB,uBACpB;;;;;;;;;;;;;;wBAsBc,uBACd,OAAO,sBACP;;;;;;;;;;;;;;;UCjMe;;EAEf;;EAEA,SAAS;;UAGM;EACf;EACA;;;;;;;;;;;;wBA2Ic,gBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;wBA4DjC,mBACd,gBACA,mBACC;;UAsCc;;EAEf;;EAEA;;;;;EAKA;;;;;;;;;;;;wBAsDc,iBAAiB,iBAAiB;;wBA6KlC,kBAAkB;;;;;;;;;;;wBAiMlB,mBAAmB,iBAAiB;;;;;;;;;;;qBC5qBvC,aAAW;;;;;;wBAOR,cAAc;;;;;;;;;;;;;;;;;;KCAlB;;;;;;;;UASK;;EAEf;;EAEA,MAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAuEc,SAAS,iBAAiB;;;;;;;;;;;;;;;;;;;UC/FzB;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,YAAY;;EAEZ;;EAEA;;;;;;;;;;;;;;;;;;;;;wBAwBc,UAAU,kBAAkB;;;;qBCpD/B;;;;;wBAaG,uBAAuB;;;;;;wBASvB,oBAAoB;;;;;;;wBAYpB,kBAAkB,gBAAgB,YAAY"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/severity/index.ts","../src/status/index.ts","../src/cvss/index.ts","../src/cwe/index.ts","../src/cpe/index.ts","../src/purl/index.ts","../src/size/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;wBAgCgB,iBAAiB;wBACjB,iBAAiB;wBACjB,iBAAiB;;;;;;;;;;wBAsBjB,4BACd,qCACA,SAAS,wBACT;;;;;;;;;wBAkBc,YAAY;;;;;;;wBAUZ,iBAAiB;wBACjB,iBAAiB;wBACjB,iBAAiB;;;;;;;;;;;;;;;;;;wBA2BjB,oBACd;;;;;;;;wBAsBc,kBAAkB;;;;;;;;;;qBC/HrB;;KASD,yBAAyB;;wBAMrB,WAAW;;;;;wBASX,YAAY;;;;;UAiBX;;EAEf;;EAEA;;EAEA;;;;;;EAMA;;;;;;;;wBAiBc,wBACd,oBAAoB,uBACpB,8BACC;;;;;;;;;wBAaa,uBACd,oBAAoB,uBACpB,WAAW,2BACX;;;;;;wBAmBc,6BACd,oBAAoB,uBACpB;;UAgBe;EACf;EACA;EACA,qBAAqB;;;;;;;;;;;;;;;wBAgBP,uBACd,OAAO,sBACP;;;;;;;;;;wBAuBc,6BACd,oBAAoB,uBACpB;;;;;;;;;;;;;;wBAsBc,uBACd,OAAO,sBACP;;;;;;;;;;;;;UCjMe;;EAEf;;EAEA,SAAS;;UAGM;EACf;EACA;;;;;;;;;;;;wBA2Ic,gBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;wBA4DjC,mBACd,gBACA,mBACC;;UAsCc;;EAEf;;EAEA;;;;;EAKA;;;;;;;;;;;;wBAsDc,iBAAiB,iBAAiB;;wBA6KlC,kBAAkB;;;;;;;;;;;wBAiMlB,mBAAmB,iBAAiB;;;;;;;;;qBC5qBvC,aAAW;;;;;;wBAOR,cAAc;;;;;;;;;;;;;;;;KCAlB;;;;;;;;UASK;;EAEf;;EAEA,MAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAuEc,SAAS,iBAAiB;;;;;;;;;;;;;;;;;UC/FzB;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,YAAY;;EAEZ;;EAEA;;;;;;;;;;;;;;;;;;;;;wBAwBc,UAAU,kBAAkB;;qBCpD/B;;;;;wBAaG,uBAAuB;;;;;;wBASvB,oBAAoB;;;;;;;wBAYpB,kBAAkB,gBAAgB,YAAY"}
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { a as canonicalChecksum, i as stringifyJSON, n as isValidJSON, o as canonicalJson, r as parseJSON, t as formatJsonNumber } from "./json-DdbPTX2g.js";
1
+ import { a as canonicalChecksum, i as stringifyJSON, n as isValidJSON, o as canonicalJson, r as parseJSON, t as formatJsonNumber } from "./json-gD9tW9Dt.js";
2
2
  import { extractColumn, findRows, findValuesByKey } from "./object/index.js";
3
3
  import { generateHash, hashObject, sha256, sha512, verifyHash } from "./hash/index.js";
4
- import { buildXml, extractTextFromXml, isValidXml, isXmlChar, parseXml, parseXmlWithArrays, xmlSafeText } from "./xml/index.js";
4
+ import { buildXml, containsXmlDoctype, containsXmlEntityDeclarations, extractTextFromXml, inspectXmlPrologue, isValidXml, isXmlChar, parseXml, parseXmlWithArrays, xmlSafeText } from "./xml/index.js";
5
5
  import { buildCsv, buildCsvArray, isValidCsv, parseCsv, parseCsvArray, sanitizeCsvArray, sanitizeCsvObject, sanitizeCsvValue } from "./csv/index.js";
6
6
  import { absentIfGoZeroTime, encodeBase64Utf8, formatTimestamp, formatTimestampSeconds, isGoZeroTime, normalizeHdfTimestamps, parseTimestamp, replaceHtmlTags, stripHtml, trimUtcFraction } from "./string/index.js";
7
- //#region src/severity/index.ts
7
+ // src/severity/index.ts
8
8
  /**
9
9
  * Severity-to-impact mapping utilities.
10
10
  *
@@ -109,8 +109,7 @@ function isUnratedSeverity(severity) {
109
109
  const s = severity.trim().toLowerCase();
110
110
  return s === "" || unratedSeverityTokens.has(s);
111
111
  }
112
- //#endregion
113
- //#region src/status/index.ts
112
+ // src/status/index.ts
114
113
  /**
115
114
  * Canonical HDF result-status ordering and effective-status computation.
116
115
  *
@@ -249,8 +248,7 @@ function computeEffectiveImpact(input, referenceTimestamp) {
249
248
  if (index >= 0) return input.overrides[index].impact;
250
249
  return input.impact;
251
250
  }
252
- //#endregion
253
- //#region src/cvss/cvss40-data.json
251
+ // src/cvss/cvss40-data.json
254
252
  var cvss40_data_default = {
255
253
  _comment: "CVSS 4.0 scoring data tables extracted VERBATIM from the FIRST reference calculator (https://github.com/FIRSTdotorg/cvss-v4-calculator; cvss_lookup.js / max_composed.js / max_severity.js). Regenerate via scratchpad/extract-data.mjs. Consumed byte-identical by Go (go/cvss40-data.json, //go:embed) and TS (src/cvss/cvss40-data.json).",
256
254
  lookup: {
@@ -600,8 +598,7 @@ var cvss40_data_default = {
600
598
  }
601
599
  }
602
600
  };
603
- //#endregion
604
- //#region src/cvss/index.ts
601
+ // src/cvss/index.ts
605
602
  /**
606
603
  * CVSS vector parsing and validation utilities.
607
604
  *
@@ -1606,8 +1603,7 @@ function computeCvss40Score(vector) {
1606
1603
  temporalScore
1607
1604
  };
1608
1605
  }
1609
- //#endregion
1610
- //#region src/cwe/index.ts
1606
+ // src/cwe/index.ts
1611
1607
  /**
1612
1608
  * CWE identifier extraction — the TypeScript twin of hdf-utilities/go/cwe.go.
1613
1609
  *
@@ -1629,8 +1625,7 @@ function extractCWEIDs(text) {
1629
1625
  ids.sort();
1630
1626
  return ids;
1631
1627
  }
1632
- //#endregion
1633
- //#region src/cpe/index.ts
1628
+ // src/cpe/index.ts
1634
1629
  const CPE_PREFIX = "cpe:2.3:";
1635
1630
  const EXPECTED_TOTAL_FIELDS = 13;
1636
1631
  const PRODUCT_FIELD_COUNT = 11;
@@ -1730,8 +1725,7 @@ function parseCpe(cpeUri) {
1730
1725
  warnings
1731
1726
  };
1732
1727
  }
1733
- //#endregion
1734
- //#region src/purl/index.ts
1728
+ // src/purl/index.ts
1735
1729
  const PURL_PREFIX = "pkg:";
1736
1730
  /**
1737
1731
  * Parse a Package URL string.
@@ -1850,8 +1844,7 @@ function safeDecode(s) {
1850
1844
  return s;
1851
1845
  }
1852
1846
  }
1853
- //#endregion
1854
- //#region src/size/index.ts
1847
+ // src/size/index.ts
1855
1848
  /** Default maximum input size (256 MB), matching the Go DefaultMaxInputSize. */
1856
1849
  const DEFAULT_MAX_INPUT_SIZE = 268435456;
1857
1850
  let configuredMaxInputSize = 0;
@@ -1910,7 +1903,6 @@ function utf8ByteLength(s) {
1910
1903
  }
1911
1904
  return bytes;
1912
1905
  }
1913
- //#endregion
1914
- export { CWE_PATTERN, DEFAULT_MAX_INPUT_SIZE, STATUS_SEVERITY_ORDER, absentIfGoZeroTime, buildCsv, buildCsvArray, buildXml, canonicalChecksum, canonicalJson, computeCvss40Score, computeCvssScore, computeEffectiveImpact, computeEffectiveStatus, cvss40MacroVector, cvssScoreToSeverity, encodeBase64Utf8, extractCWEIDs, extractColumn, extractColumn as extractCsvColumn, extractTextFromXml, findRows as findCsvRows, findRows, findValuesByKey as findJsonValues, findValuesByKey, findValuesByKey as findXmlValues, formatJsonNumber, formatTimestamp, formatTimestampSeconds, generateHash, governingImpactOverrideIndex, governingOverrideIndex, governingStatusOverride, governingStatusOverrideIndex, hashObject, impactToSeverity, isGoZeroTime, isUnratedSeverity, isValidCsv, isValidJSON, isValidXml, isXmlChar, normalizeHdfTimestamps, parseCpe, parseCsv, parseCsvArray, parseCvssVector, parseJSON, parsePurl, parseTimestamp, parseXml, parseXmlWithArrays, replaceHtmlTags, resolveMaxInputSize, roundImpact, sanitizeCsvArray, sanitizeCsvObject, sanitizeCsvValue, setDefaultMaxInputSize, severityToImpact, severityToImpactWithAliases, sha256, sha512, statusRank, stringifyJSON, stripHtml, trimUtcFraction, validateCvssVector, validateInputSize, verifyHash, worstStatus, xmlSafeText };
1906
+ export { CWE_PATTERN, DEFAULT_MAX_INPUT_SIZE, STATUS_SEVERITY_ORDER, absentIfGoZeroTime, buildCsv, buildCsvArray, buildXml, canonicalChecksum, canonicalJson, computeCvss40Score, computeCvssScore, computeEffectiveImpact, computeEffectiveStatus, containsXmlDoctype, containsXmlEntityDeclarations, cvss40MacroVector, cvssScoreToSeverity, encodeBase64Utf8, extractCWEIDs, extractColumn, extractColumn as extractCsvColumn, extractTextFromXml, findRows as findCsvRows, findRows, findValuesByKey as findJsonValues, findValuesByKey, findValuesByKey as findXmlValues, formatJsonNumber, formatTimestamp, formatTimestampSeconds, generateHash, governingImpactOverrideIndex, governingOverrideIndex, governingStatusOverride, governingStatusOverrideIndex, hashObject, impactToSeverity, inspectXmlPrologue, isGoZeroTime, isUnratedSeverity, isValidCsv, isValidJSON, isValidXml, isXmlChar, normalizeHdfTimestamps, parseCpe, parseCsv, parseCsvArray, parseCvssVector, parseJSON, parsePurl, parseTimestamp, parseXml, parseXmlWithArrays, replaceHtmlTags, resolveMaxInputSize, roundImpact, sanitizeCsvArray, sanitizeCsvObject, sanitizeCsvValue, setDefaultMaxInputSize, severityToImpact, severityToImpactWithAliases, sha256, sha512, statusRank, stringifyJSON, stripHtml, trimUtcFraction, validateCvssVector, validateInputSize, verifyHash, worstStatus, xmlSafeText };
1915
1907
 
1916
1908
  //# sourceMappingURL=index.js.map