calculateStatementFideId
Calculate a Fide ID for a Statement from its RDF triple components. Creates a statement Fide ID by hashing a canonical JSON representation of the subject-predicate-object triple. The resulting Fide ID always has type and source both set to Statement (0x00...).
Parameters
Returns
Prop
Type
import { calculateStatementFideId } from '@fide.work/fcp';
const result = await calculateStatementFideId(
'did:fide:0x152f02f1d1c1e62b2e569e11818420c1968be3d9',
'did:fide:0x6524b049fa7069dd318c44531214a955c3f1fa37',
'did:fide:0x66a023246354ad7e064b1e4e009ec8a0699a3043'
);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.
extractFideIdFingerprint
Extract the 38-character fingerprint from a Fide ID. The fingerprint comprises the last 38 hex characters after the type and source bytes, representing the last 19 bytes of the SHA-256 hash used to create the Fide ID.