Socket
Socket
Sign inDemoInstall

multihashes-sync

Package Overview
Dependencies
2
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    multihashes-sync

Synchronous SHA256, SHA512 multihashes


Version published
Weekly downloads
2.6K
increased by10.63%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

multihashes-sync

Sync Multihash implementation.

Spiritual successor to deprecated multihashing. Compatible with multiformats.

Install

> pnpm install multihashes-sync

Usage

import { sha256, sha512 } from 'multihashes-sync/sha2'
var bytes = Uint8Array.from([0, 1, 2, 3])

var digest = sha256.digest(bytes)
> console.log(digest)
Digest {
  code: 18,
  size: 32,
  digest: <Buffer 05 4e de c1 d0 21 1f 62 4f ed 0c bc a9 d4 f9 40 0b 0e 49 1c 43 74 2a f2 c5 b0 ab eb f0 c9 90 d8>,
  bytes: Uint8Array(34) [
     18,  32,   5,  78, 222, 193, 208,  33,
     31,  98,  79, 237,  12, 188, 169, 212,
    249,  64,  11,  14,  73,  28,  67, 116,
     42, 242, 197, 176, 171, 235, 240, 201,
    144, 216
  ]
}

License

MIT or Apache-2.0

Keywords

FAQs

Last updated on 03 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc