@bcts/provenance-mark 1.0.0-alpha.20 → 1.0.0-alpha.21
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/LICENSE +2 -1
- package/dist/index.cjs +58 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +20 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.iife.js +58 -0
- package/dist/index.iife.js.map +1 -1
- package/dist/index.mjs +58 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -25
- package/src/crypto-utils.ts +6 -0
- package/src/date.ts +6 -0
- package/src/envelope.ts +4 -0
- package/src/error.ts +6 -0
- package/src/generator.ts +6 -0
- package/src/index.ts +6 -0
- package/src/mark-info.ts +6 -0
- package/src/mark.ts +6 -0
- package/src/resolution.ts +6 -0
- package/src/rng-state.ts +6 -0
- package/src/seed.ts +6 -0
- package/src/utils.ts +4 -0
- package/src/validate.ts +6 -0
- package/src/xoshiro256starstar.ts +6 -0
package/dist/index.mjs
CHANGED
|
@@ -9,6 +9,11 @@ import { Envelope, FormatContext, registerTagsIn as registerTagsIn$1, withFormat
|
|
|
9
9
|
|
|
10
10
|
//#region src/error.ts
|
|
11
11
|
/**
|
|
12
|
+
* Copyright © 2023-2026 Blockchain Commons, LLC
|
|
13
|
+
* Copyright © 2025-2026 Parity Technologies
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
12
17
|
* Error types for Provenance Mark operations.
|
|
13
18
|
*/
|
|
14
19
|
let ProvenanceMarkErrorType = /* @__PURE__ */ function(ProvenanceMarkErrorType) {
|
|
@@ -112,6 +117,11 @@ var ProvenanceMarkError = class ProvenanceMarkError extends Error {
|
|
|
112
117
|
//#endregion
|
|
113
118
|
//#region src/date.ts
|
|
114
119
|
/**
|
|
120
|
+
* Copyright © 2023-2026 Blockchain Commons, LLC
|
|
121
|
+
* Copyright © 2025-2026 Parity Technologies
|
|
122
|
+
*
|
|
123
|
+
*/
|
|
124
|
+
/**
|
|
115
125
|
* Reference date for 4-byte and 6-byte serialization (2001-01-01T00:00:00Z).
|
|
116
126
|
*/
|
|
117
127
|
const REFERENCE_DATE = Date.UTC(2001, 0, 1, 0, 0, 0, 0);
|
|
@@ -250,6 +260,11 @@ function dateToDateString(date) {
|
|
|
250
260
|
//#endregion
|
|
251
261
|
//#region src/resolution.ts
|
|
252
262
|
/**
|
|
263
|
+
* Copyright © 2023-2026 Blockchain Commons, LLC
|
|
264
|
+
* Copyright © 2025-2026 Parity Technologies
|
|
265
|
+
*
|
|
266
|
+
*/
|
|
267
|
+
/**
|
|
253
268
|
* Resolution levels for provenance marks.
|
|
254
269
|
* Higher resolution provides more security but larger mark sizes.
|
|
255
270
|
*/
|
|
@@ -457,6 +472,11 @@ function resolutionFromCbor(cborValue) {
|
|
|
457
472
|
|
|
458
473
|
//#endregion
|
|
459
474
|
//#region src/crypto-utils.ts
|
|
475
|
+
/**
|
|
476
|
+
* Copyright © 2023-2026 Blockchain Commons, LLC
|
|
477
|
+
* Copyright © 2025-2026 Parity Technologies
|
|
478
|
+
*
|
|
479
|
+
*/
|
|
460
480
|
const SHA256_SIZE = 32;
|
|
461
481
|
/**
|
|
462
482
|
* Compute SHA-256 hash of data.
|
|
@@ -497,6 +517,11 @@ function obfuscate(key, message) {
|
|
|
497
517
|
//#endregion
|
|
498
518
|
//#region src/xoshiro256starstar.ts
|
|
499
519
|
/**
|
|
520
|
+
* Copyright © 2023-2026 Blockchain Commons, LLC
|
|
521
|
+
* Copyright © 2025-2026 Parity Technologies
|
|
522
|
+
*
|
|
523
|
+
*/
|
|
524
|
+
/**
|
|
500
525
|
* Xoshiro256** PRNG implementation.
|
|
501
526
|
* A fast, high-quality pseudorandom number generator.
|
|
502
527
|
*/
|
|
@@ -619,6 +644,11 @@ var Xoshiro256StarStar = class Xoshiro256StarStar {
|
|
|
619
644
|
|
|
620
645
|
//#endregion
|
|
621
646
|
//#region src/rng-state.ts
|
|
647
|
+
/**
|
|
648
|
+
* Copyright © 2023-2026 Blockchain Commons, LLC
|
|
649
|
+
* Copyright © 2025-2026 Parity Technologies
|
|
650
|
+
*
|
|
651
|
+
*/
|
|
622
652
|
const RNG_STATE_LENGTH = 32;
|
|
623
653
|
/**
|
|
624
654
|
* RNG state for provenance marks (32 bytes).
|
|
@@ -670,6 +700,11 @@ var RngState = class RngState {
|
|
|
670
700
|
|
|
671
701
|
//#endregion
|
|
672
702
|
//#region src/seed.ts
|
|
703
|
+
/**
|
|
704
|
+
* Copyright © 2023-2026 Blockchain Commons, LLC
|
|
705
|
+
* Copyright © 2025-2026 Parity Technologies
|
|
706
|
+
*
|
|
707
|
+
*/
|
|
673
708
|
const PROVENANCE_SEED_LENGTH = 32;
|
|
674
709
|
/**
|
|
675
710
|
* A seed for generating provenance marks.
|
|
@@ -743,6 +778,10 @@ var ProvenanceSeed = class ProvenanceSeed {
|
|
|
743
778
|
//#endregion
|
|
744
779
|
//#region src/utils.ts
|
|
745
780
|
/**
|
|
781
|
+
* Copyright © 2023-2026 Blockchain Commons, LLC
|
|
782
|
+
* Copyright © 2025-2026 Parity Technologies
|
|
783
|
+
*
|
|
784
|
+
*
|
|
746
785
|
* Utility functions for byte array conversions.
|
|
747
786
|
*
|
|
748
787
|
* These functions provide cross-platform support for common byte manipulation
|
|
@@ -1061,6 +1100,11 @@ function hexDecode(hex) {
|
|
|
1061
1100
|
//#endregion
|
|
1062
1101
|
//#region src/mark.ts
|
|
1063
1102
|
/**
|
|
1103
|
+
* Copyright © 2023-2026 Blockchain Commons, LLC
|
|
1104
|
+
* Copyright © 2025-2026 Parity Technologies
|
|
1105
|
+
*
|
|
1106
|
+
*/
|
|
1107
|
+
/**
|
|
1064
1108
|
* A cryptographically-secured provenance mark.
|
|
1065
1109
|
*/
|
|
1066
1110
|
var ProvenanceMark = class ProvenanceMark {
|
|
@@ -1529,6 +1573,11 @@ function arraysEqual(a, b) {
|
|
|
1529
1573
|
//#endregion
|
|
1530
1574
|
//#region src/generator.ts
|
|
1531
1575
|
/**
|
|
1576
|
+
* Copyright © 2023-2026 Blockchain Commons, LLC
|
|
1577
|
+
* Copyright © 2025-2026 Parity Technologies
|
|
1578
|
+
*
|
|
1579
|
+
*/
|
|
1580
|
+
/**
|
|
1532
1581
|
* Generator for creating provenance mark chains.
|
|
1533
1582
|
*/
|
|
1534
1583
|
var ProvenanceMarkGenerator = class ProvenanceMarkGenerator {
|
|
@@ -1709,6 +1758,11 @@ var ProvenanceMarkGenerator = class ProvenanceMarkGenerator {
|
|
|
1709
1758
|
//#endregion
|
|
1710
1759
|
//#region src/mark-info.ts
|
|
1711
1760
|
/**
|
|
1761
|
+
* Copyright © 2023-2026 Blockchain Commons, LLC
|
|
1762
|
+
* Copyright © 2025-2026 Parity Technologies
|
|
1763
|
+
*
|
|
1764
|
+
*/
|
|
1765
|
+
/**
|
|
1712
1766
|
* Wrapper for a provenance mark with additional display information.
|
|
1713
1767
|
*/
|
|
1714
1768
|
var ProvenanceMarkInfo = class ProvenanceMarkInfo {
|
|
@@ -1799,6 +1853,10 @@ var ProvenanceMarkInfo = class ProvenanceMarkInfo {
|
|
|
1799
1853
|
//#endregion
|
|
1800
1854
|
//#region src/envelope.ts
|
|
1801
1855
|
/**
|
|
1856
|
+
* Copyright © 2023-2026 Blockchain Commons, LLC
|
|
1857
|
+
* Copyright © 2025-2026 Parity Technologies
|
|
1858
|
+
*
|
|
1859
|
+
*
|
|
1802
1860
|
* Envelope support for Provenance Marks
|
|
1803
1861
|
*
|
|
1804
1862
|
* This module provides Gordian Envelope integration for ProvenanceMark and
|