sdk-js

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

Class: DID

Decentralized ID.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new DID(id): DID

Parameters

Name Type
id string

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

Name Type Description
encoded string Base36 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

Name Type Description
didString string | DID DID 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

Name Type Default value
value any undefined
radix number 36

Returns

any

Defined in

src/nevermined/DID.ts:48