1.0.1 • Published 11 months ago

@mtvproject/hashing v1.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
11 months ago

@mtvproject/hashing

Hashing functions to calculate Memetaverse 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 @mtvproject/hashing

import { hashV1 } from '@mtvproject/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
1.0.1

11 months ago

1.0.0

11 months ago