multihash-maker
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Multihash Maker

Multihash Maker is a simple way to create multihashes with no external dependencies.

Read more about multihash and the multihash specification here https://multiformats.io/multihash/

Install

npm install multihash-maker

Usage

import { createMultiHash, parseMultiHash } from '../lib/index';

createMultiHash('Hello World!', 'sha256')
// Returns '22041dd7b6443542e75701aa98a0c235951a28a0d851b11564d20022ab11d2589a8'

parseMultiHash('11148a173fd3e32c0fa78b90fe42d305f202244e2739')
// Returns {
      length: 20,
      hashFunction: "sha1",
      hash: "8a173fd3e32c0fa78b90fe42d305f202244e2739"
    }

Tests

npm test

License

The MIT License

Copyright (c) 2023 Adam Shea

Readme

Keywords

none

Package Sidebar

Install

npm i multihash-maker

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

5.86 kB

Total Files

7

Last publish

Collaborators

  • adamshea