@mtvproject/hashing
v1.0.1
Published
base component
Downloads
3
Readme
@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