@bcts/provenance-mark 1.0.0-beta.4 → 1.0.0-beta.6
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/dist/index.cjs +11 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.iife.js +11 -7
- package/dist/index.iife.js.map +1 -1
- package/dist/index.mjs +11 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
package/dist/index.cjs
CHANGED
|
@@ -558,7 +558,8 @@ function obfuscate(key, message) {
|
|
|
558
558
|
const extendedKey = extendKey(key instanceof Uint8Array ? key : new Uint8Array(key));
|
|
559
559
|
const iv = /* @__PURE__ */ new Uint8Array(12);
|
|
560
560
|
for (let i = 0; i < 12; i++) iv[i] = extendedKey[31 - i];
|
|
561
|
-
|
|
561
|
+
const messageBytes = message instanceof Uint8Array ? message : new Uint8Array(message);
|
|
562
|
+
return (0, _noble_ciphers_chacha_js.chacha20)(extendedKey, iv, messageBytes);
|
|
562
563
|
}
|
|
563
564
|
//#endregion
|
|
564
565
|
//#region src/seed.ts
|
|
@@ -1005,9 +1006,7 @@ function formatText(report) {
|
|
|
1005
1006
|
case "NonGenesisAtZero":
|
|
1006
1007
|
issueStr = "non-genesis at seq 0";
|
|
1007
1008
|
break;
|
|
1008
|
-
case "InvalidGenesisKey":
|
|
1009
|
-
issueStr = "invalid genesis key";
|
|
1010
|
-
break;
|
|
1009
|
+
case "InvalidGenesisKey": issueStr = "invalid genesis key";
|
|
1011
1010
|
}
|
|
1012
1011
|
annotations.push(issueStr);
|
|
1013
1012
|
}
|
|
@@ -1590,7 +1589,8 @@ var ProvenanceMark = class ProvenanceMark {
|
|
|
1590
1589
|
* Decode from URL encoding.
|
|
1591
1590
|
*/
|
|
1592
1591
|
static fromUrlEncoding(urlEncoding) {
|
|
1593
|
-
const
|
|
1592
|
+
const cborData = (0, _bcts_uniform_resources.decodeBytewords)(urlEncoding, _bcts_uniform_resources.BytewordsStyle.Minimal);
|
|
1593
|
+
const cborValue = (0, _bcts_dcbor.decodeCbor)(cborData);
|
|
1594
1594
|
return ProvenanceMark.fromTaggedCbor(cborValue);
|
|
1595
1595
|
}
|
|
1596
1596
|
/**
|
|
@@ -2049,7 +2049,10 @@ var ProvenanceMarkInfo = class ProvenanceMarkInfo {
|
|
|
2049
2049
|
* and vice versa).
|
|
2050
2050
|
*/
|
|
2051
2051
|
static new(mark, comment = "") {
|
|
2052
|
-
|
|
2052
|
+
const ur = mark.ur();
|
|
2053
|
+
const bytewords = mark.idBytewords(4, true);
|
|
2054
|
+
const bytemoji = mark.idBytemoji(4, true);
|
|
2055
|
+
return new ProvenanceMarkInfo(mark, ur, bytewords, bytemoji, comment);
|
|
2053
2056
|
}
|
|
2054
2057
|
mark() {
|
|
2055
2058
|
return this._mark;
|
|
@@ -2121,7 +2124,8 @@ var ProvenanceMarkInfo = class ProvenanceMarkInfo {
|
|
|
2121
2124
|
const ur = mark.ur();
|
|
2122
2125
|
const bytewords = json["bytewords"];
|
|
2123
2126
|
const bytemoji = json["bytemoji"];
|
|
2124
|
-
|
|
2127
|
+
const comment = typeof json["comment"] === "string" ? json["comment"] : "";
|
|
2128
|
+
return new ProvenanceMarkInfo(mark, ur, bytewords, bytemoji, comment);
|
|
2125
2129
|
}
|
|
2126
2130
|
};
|
|
2127
2131
|
//#endregion
|