Skip to main content

DID

@nevermined-io/sdk - v3.0.44 / DID

Class: DID

Decentralized ID.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new DID(id): DID

Parameters

NameType
idstring

Returns

DID

Defined in

src/nevermined/DID.ts:84

Properties

id

Private id: string

Short ID.

Defined in

src/nevermined/DID.ts:82

Methods

getDid

getDid(): string

Returns the DID (i.e did:nv:...)

Returns

string

A string with the prefixed id.

Defined in

src/nevermined/DID.ts:92


getEncoded

getEncoded(): string

Generates an encoded string in base 36 from a DID.

Returns

string

A base36 encoded string.

Defined in

src/nevermined/DID.ts:75


getId

getId(): string

Returns the Short ID.

Returns

string

A string of the id without the prefix.

Defined in

src/nevermined/DID.ts:100


fromEncoded

fromEncoded(encoded): DID

Returns a new DID from a base36 encoded string.

Parameters

NameTypeDescription
encodedstringBase36 encoded string.

Returns

DID

DID

Defined in

src/nevermined/DID.ts:65


generate

generate(): DID

Returns a new DID.

Returns

DID

DID

Defined in

src/nevermined/DID.ts:44


parse

parse(didString): DID

Parses a DID from a string.

Parameters

NameTypeDescription
didStringstring | DIDDID in string format or DID instance. The didString can be in did:nv: format or 0x: format.

Returns

DID

DID

Defined in

src/nevermined/DID.ts:14


parseBigInt

parseBigInt(value, radix?): any

Parameters

NameTypeDefault value
valueanyundefined
radixnumber36

Returns

any

Defined in

src/nevermined/DID.ts:48