ipld-dag-cbor
0.13.1

Intro

Installable via npm install --save ipld-dag-cbor, it can also be used directly in the browser.

Download

The source is available for download from GitHub. Alternatively, you can install using npm:

$ npm install --save ipld-dag-cbor

You can then require() ipld-dag-cbor as normal:

const ipldDagCbor = require('ipld-dag-cbor')

In the Browser

Ipld-dag-cbor should work in any ES2015 environment out of the box.

Usage:

<script type="text/javascript" src="index.js"></script>

The portable versions of ipld-dag-cbor, including index.js and index.min.js, are included in the /dist folder. Ipld-dag-cbor can also be found on unpkg.com under

CidCallback

Parameters

  1. error: Error?:  
    Error if getting the CID failed
  2. cid: CID?:  
    CID if call was successful

cid

Get the CID of the DAG-Node.

Parameters

  1. dagNode: Object:  
    Internal representation
  2. options: Object?:  
    Options to create the CID
  3. options.version: number (=1):  
    CID version number
  4. options.hashAlg: string?:  
    Defaults to hashAlg for the resolver
  5. options.hashLen: number?:  
    Optionally trim the digest to this length
  6. callback: CidCallback:  
    Callback that handles the return value

Returns

void