oca_package 1.2.4 → 1.3.0
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/cjs/index.js +3 -1
- package/dist/cjs/verify.js +15 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/verify.js +12 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/verify.d.ts +8 -0
- package/dist/types/verify.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -3,6 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.OcaPackage = void 0;
|
|
6
|
+
exports.VerifyOcaPackage = exports.OcaPackage = void 0;
|
|
7
7
|
var oca_package_js_1 = require("./oca_package.js");
|
|
8
8
|
Object.defineProperty(exports, "OcaPackage", { enumerable: true, get: function () { return __importDefault(oca_package_js_1).default; } });
|
|
9
|
+
var verify_js_1 = require("./verify.js");
|
|
10
|
+
Object.defineProperty(exports, "VerifyOcaPackage", { enumerable: true, get: function () { return verify_js_1.VerifyOcaPackage; } });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VerifyOcaPackage = VerifyOcaPackage;
|
|
4
|
+
const saidify_1 = require("saidify");
|
|
5
|
+
/**
|
|
6
|
+
* Verifies the OCA package against a digest.
|
|
7
|
+
* @param oca_package - The OCA package to verify.
|
|
8
|
+
* @param digest - The digest to verify against.
|
|
9
|
+
* @returns {boolean} - Returns true if the verification is successful, otherwise false.
|
|
10
|
+
*/
|
|
11
|
+
function VerifyOcaPackage(oca_package, digest) {
|
|
12
|
+
const label = 'd';
|
|
13
|
+
// prefixed is set to true this avoid d = '' to be considered as a valid self-addressing data
|
|
14
|
+
return (0, saidify_1.verify)(oca_package, digest, label, saidify_1.SAIDDex.Blake3_256, saidify_1.Serials.JSON, true);
|
|
15
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { verify, SAIDDex, Serials } from 'saidify';
|
|
2
|
+
/**
|
|
3
|
+
* Verifies the OCA package against a digest.
|
|
4
|
+
* @param oca_package - The OCA package to verify.
|
|
5
|
+
* @param digest - The digest to verify against.
|
|
6
|
+
* @returns {boolean} - Returns true if the verification is successful, otherwise false.
|
|
7
|
+
*/
|
|
8
|
+
export function VerifyOcaPackage(oca_package, digest) {
|
|
9
|
+
const label = 'd';
|
|
10
|
+
// prefixed is set to true this avoid d = '' to be considered as a valid self-addressing data
|
|
11
|
+
return verify(oca_package, digest, label, SAIDDex.Blake3_256, Serials.JSON, true);
|
|
12
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verifies the OCA package against a digest.
|
|
3
|
+
* @param oca_package - The OCA package to verify.
|
|
4
|
+
* @param digest - The digest to verify against.
|
|
5
|
+
* @returns {boolean} - Returns true if the verification is successful, otherwise false.
|
|
6
|
+
*/
|
|
7
|
+
export declare function VerifyOcaPackage(oca_package: any, digest: string): boolean;
|
|
8
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/verify.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAI1E"}
|