UNPKG

jsonld-signatures-merkleproof2019

Version:

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

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