UNPKG

jsonld-signatures-merkleproof2019

Version:

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

12 lines (10 loc) 321 B
import { startsWith } from './string.js'; export function prependHashPrefix (remoteHash: string, prefixes: string[]): string { for (let i = 0; i < prefixes.length; i++) { const prefix = prefixes[i]; if (!startsWith(remoteHash, prefix)) { return `${prefix}${remoteHash}`; } } return remoteHash; }