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.
Node Runtime Required
Parameters
Returns
Prop
Type
import { buildFideIdFromParts } from '@fide-work/context-protocol';
const result = buildFideIdFromParts(
'10',
'20',
'5fcbdc6d73bcfcd2c73eb4795c2f02f1d1c1'
);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}`assertFideId
Assert that a value is a properly formatted Fide ID. Valid format is: `did:fide:0x` prefix followed by exactly 40 hexadecimal characters (case-insensitive).
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.