parseFideId
Parse a Fide ID into its constituent components. Decomposes a Fide ID into entity type code (2 hex), reference type code (2 hex), and fingerprint (36 hex), converting type/source codes to their corresponding entity type names.
Node Runtime Required
Parameters
Returns
Prop
Type
import { parseFideId } from '@fide-work/context-protocol';
const result = parseFideId('did:fide:0x10205fcbdc6d73bcfcd2c73eb4795c2f02f1d1c1');Related Constants
FIDE_CHAR_TO_ENTITY_TYPE
export const FIDE_CHAR_TO_ENTITY_TYPE: Record<"00" | "01" | "02" | "10" | "11" | "12" | "20" | "21" | "22" | "30" | "31" | "40" | "41" | "42" | "43" | "a0" | "a1" | "a2" | "a3" | "b1" | "b2" | "b3" | "b4" | "b0" | "b5" | "c0" | "c1", "Statement" | "DirectionalProperty" | "SymmetricProperty" | "Person" | "Organization" | "SoftwareAgent" | "NetworkResource" | "PlatformAccount" | "CryptographicAccount" | "CreativeWork" | "Concept" | "Place" | "Event" | "Action" | "PhysicalObject" | "TextLiteral" | "IntegerLiteral" | "DecimalLiteral" | "BoolLiteral" | "DateLiteral" | "YearMonthLiteral" | "YearLiteral" | "TimeLiteral" | "DateTimeLiteral" | "DurationLiteral" | "URILiteral" | "JSONLiteral">Type Definitions
type FideId
Full Fide ID format (with did:fide:0x prefix). Length: 11 ("did:fide:0x") + 40 hex = 51 chars.
`did:fide:0x${string}`type ParsedFideId
Parsed Fide ID components.
ParsedFideIdProperties
Prop
Type
type FideEntityTypeChar
Two-character entity type codes (hex) derived from `FIDE_ENTITY_TYPE_MAP`.
FideEntityTypeCharValid Fide entity type names derived from `FIDE_ENTITY_TYPE_MAP`.
"Statement" | "DirectionalProperty" | "SymmetricProperty" | "Person" | "Organization" | "SoftwareAgent" | "NetworkResource" | "PlatformAccount" | "CryptographicAccount" | "CreativeWork" | "Concept" | "Place" | "Event" | "Action" | "PhysicalObject" | "TextLiteral" | "IntegerLiteral" | "DecimalLiteral" | "BoolLiteral" | "DateLiteral" | "YearMonthLiteral" | "YearLiteral" | "TimeLiteral" | "DateTimeLiteral" | "DurationLiteral" | "URILiteral" | "JSONLiteral"type FideFingerprint
Fide ID fingerprint segment (36 hex characters, 18 bytes).
stringnormalizeReferenceIdentifier
Normalize a reference identifier for general entity usage. For http(s) URLs this canonicalizes protocol/host casing and removes default ports. Non-URL values are returned unchanged.
compactPropertyReferenceIdentifier
Compact a full property IRI (e.g. `https://schema.org/name`) to CURIE form. Returns the original input unchanged when it does not match a configured prefix.