1.6.0 • Published 3 months ago

iso-did v1.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

iso-did NPM Version License iso-did

Isomorphic did core and did key tooling

Install

pnpm install iso-did

Usage

import { DID } from 'iso-did'

const did = DID.fromString(
  'did:example:21tDAKCERh95uGgKbJNHYp;service=agent;foo:bar=high/some/path?foo=bar#key1'
)

// did.did = 'did:example:21tDAKCERh95uGgKbJNHYp'
// did.id = '21tDAKCERh95uGgKbJNHYp'
// did.method = 'example'
// did.path = '/some/path'
// did.fragment = 'key1'
import { DIDKey } from 'iso-did/key'

const did1 = DIDKey.fromString(
  'did:key:z6MkiTBz1ymuepAQ4HEHYSF1H8quG5GLVVQR3djdX3mDooWp'
)

// did1.key = Uint8Array([1, 2, 3, 4])
// did1.code = 0xed
// did1.type = 'ED25519'

const did2 = DIDKey.fromPublicKey('ED25519', publicKeyBytes)

// did2.id = z6MkiTBz1ymuepAQ4HEHYSF1H8quG5GLVVQR3djdX3mDooWp
// did2.did = did:key:z6MkiTBz1ymuepAQ4HEHYSF1H8quG5GLVVQR3djdX3mDooWp

Docs

Check https://hugomrdias.github.io/iso-repo/modules/iso_did.html

License

MIT © Hugo Dias

1.6.0

3 months ago

1.5.0

5 months ago

1.4.0

5 months ago

1.3.4

5 months ago

1.3.3

8 months ago

1.3.2

9 months ago

1.3.1

10 months ago

1.3.0

11 months ago

1.2.0

11 months ago

1.1.0

12 months ago

1.0.0

12 months ago

0.1.5

12 months ago

0.1.0

12 months ago