calculateFideId
Core primitive: calculate a Fide ID from type codes and reference identifier. Deterministic SHA-256 hash of the reference identifier (UTF-8), then constructs `did:fide:0x` + 2 hex (entity type) + 2 hex (reference type) + first 36 hex of hash = 40 hex total.
Node Runtime Required
Parameters
Returns
Prop
Type
import { calculateFideId } from '@fide-work/context-protocol';
const result = await calculateFideId(
'Person',
'NetworkResource',
'https://x.com/alice',
);Type Definitions
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 FideIdCalculationOptions
Options for Fide ID calculation helpers. Reserved for forward-compatible toggles without changing function signatures.
FideIdCalculationOptionsProperties
Prop
Type
buildFideIdFromParts
Build a Fide ID from type code, source code, and fingerprint (no hashing). Use when you already have the fingerprint (e.g. from a database) and need to reconstruct the full Fide ID. For computing a new Fide ID from a reference identifier, use `calculateFideId` instead.
calculateStatementFideId
Calculate a Fide ID for a Statement from its RDF triple components. Creates a statement Fide ID by hashing the reference identifier: concatenation of subject, property, and object Fide IDs in that order, separated by ASCII `|`. No whitespace. This helper always returns the self-referential Statement form (Entity Type/Reference Type = `0000`).