ipld-dag-pb
0.15.2

Intro

Installable via npm install --save ipld-dag-pb, 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-pb

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

const ipldDagPb = require('ipld-dag-pb')

In the Browser

Ipld-dag-pb 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-pb, including index.js and index.min.js, are included in the /dist folder. Ipld-dag-pb 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?:  
    CID version number. Defaults to zero if hashAlg == 'sha2-256'; otherwise, 1.
  4. options.hashAlg: string?:  
    Defaults to hashAlg for the resolver
  5. callback: CidCallback:  
    Callback that handles the return value

Returns

void