uriToEntryIdAndDigest
uriToEntryIdAndDigest(
registryEntryUri):object
Extracts the identifier and digest from a given registry entry URI.
Parameters
Section titled “Parameters”• registryEntryUri: `entry:cord:${string}`
The registry entry URI to be parsed. Format: ‘entry:cord:
Returns
Section titled “Returns”object
An object containing the extracted identifier and digest.
digest
Section titled “digest”digest:
HexString
identifier
Section titled “identifier”identifier:
string
Remarks
Section titled “Remarks”This function parses a registry entry URI and extracts the identifier and digest components.
Example
Section titled “Example”const entryUri = 'entry:cord:1234:abcd';const { identifier, digest } = uriToEntryIdAndDigest(entryUri);console.log('Identifier:', identifier, 'Digest:', digest);Throws
Section titled “Throws”If the registryEntryUri does not follow the expected format.
Description
Section titled “Description”The function splits the registryEntryUri string and validates its format. If valid, it returns the identifier
and the digest (with ‘0x’ prefix).