calculateFideId

Calculate a Fide ID for an entity from its type, source type, and raw identifier. Generates a unique identifier by creating a SHA-256 hash of the raw identifier, then constructing a Fide ID with type and source characters followed by the last 38 hex characters.

calculateFideId(entityType, sourceEntityType, rawIdentifier)

Parameters

entityTypeFideEntityType*
The entity type.
sourceEntityTypeFideEntityType*
The source entity type.
rawIdentifierstring*
The raw identifier string to hash.

Returns

Prop

Type

import { calculateFideId } from '@fide.work/fcp';

const result = await calculateFideId(
  'Person',
  'Product',
  'https://x.com/alice'
);

Type Definitions

type FideEntityTypeRelated docs

Valid FCP entity type names derived from `FIDE_ENTITY_TYPE_MAP`.

"Statement" | "Person" | "Organization" | "AutonomousAgent" | "Place" | "Event" | "Product" | "CreativeWork"