JSPM

  • Created
  • Published
  • Downloads 7017
  • Score
    100M100P100Q131744F
  • License Apache-2.0

base component

Package Exports

  • @dcl/hashing
  • @dcl/hashing/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@dcl/hashing) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@dcl/hashing

Coverage Status

Hashing functions to calculate Decentraland Content Identifiers

  • hashV1(arg): Promise<string>: ba prefixed hashes are IPFSv1 hashes. Calculating hashes for files should generate the same result as an IPFS node.
  • DEPRECATED hashV0(arg): Promise<string>: Qm prefixed hashes are not IPFSv0 hashes, although it uses the same encoding (Qm...). These

npm i @dcl/hashing

import { hashV1 } from '@dcl/hashing'

// use with Node.js Buffers or Uint8Array
cid = await hashV1(fs.readFileSync('file'))

// use with fs.ReadStream
cid = await hashV1(fs.createReadStream('file'))

// => bafybeibdik2ihfpcdi7aaaguptwcoc5msav7uhn5hu54xlq2pdwkh5arzy