Skip to content

Steven-Mugisha/saidify

 
 

Repository files navigation

SAIDify - (sēdəˌfī)

trunk codecov npm version

Generate self-addressing identifiers on arbitrary data.

Usage

Typescript

Install the package via NPM/PNPM:

npm install saidify

Import 'saidify' and SAIDify your data:

import { saidify, verify } from 'saidify'

// create data to become self-addressing
const myData = {
  a: 1,
  b: 2,
  d: '',
}
const label = 'd'
const said = saidify(myData, label)
console.log(said)
// ...Vitest test assertion
expect(said).toEqual('ELLbizIr2FJLHexNkiLZpsTWfhwUmZUicuhmoZ9049Hz')

// verify self addressing identifier
const computedSAID = 'ELLbizIr2FJLHexNkiLZpsTWfhwUmZUicuhmoZ9049Hz'
const doesVerify = verify(myData, computedSAID, label)
// ...Vitest test assertion
expect(doesVerify).toEqual(true)

You may find a full example Typescript project at saidify-example.

Description

A self-addressing identifier (SAID) is a kind of content-addressable identifier that uses a two-pass approach to enable embedding of the identifier in the content itself, thus the name self-addressing rather than content addressing.

A number of different specifications describe SAIDs.

Sources and References

  • signify-ts
    • Most of the code in this repository is lifed from the SignifyTS project.
  • keripy
    • Some of the code in this repository is inspired by KERIpy, the Python implementation of KERI.

Development Statistics

Alt

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 95.0%
  • JavaScript 5.0%