UNPKG

jsonld-signatures-merkleproof2019

Version:

A jsonld signature implementation to support MerkleProof2019 verification in Verifiable Credential context

14 lines (13 loc) 444 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.prependHashPrefix = prependHashPrefix; const string_1 = require("./string"); function prependHashPrefix(remoteHash, prefixes) { for (let i = 0; i < prefixes.length; i++) { const prefix = prefixes[i]; if (!(0, string_1.startsWith)(remoteHash, prefix)) { return `${prefix}${remoteHash}`; } } return remoteHash; }