Fide logoFIDE

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

This function requires a Node.js runtime and is disabled in the browser docs preview.
parseFideId(fideId)

Parameters

fideIdFideId*
The Fide ID reference (format: did:fide:0x...)

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.

ParsedFideId

Properties

Prop

Type

type FideEntityTypeChar

Two-character entity type codes (hex) derived from `FIDE_ENTITY_TYPE_MAP`.

FideEntityTypeChar
type FideEntityTypeRelated docsLarge type

Valid 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).

string