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
error: Error?
:Error if getting the CID failedcid: CID?
:CID if call was successful
cid
Get the CID of the DAG-Node.
Parameters
dagNode: Object
:Internal representationoptions: Object?
:Options to create the CIDoptions.version: number?
:CID version number. Defaults to zero if hashAlg == 'sha2-256'; otherwise, 1.options.hashAlg: string?
:Defaults to hashAlg for the resolvercallback: CidCallback
:Callback that handles the return value
Returns
void