Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sync-multihash-sha2

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sync-multihash-sha2

Sync sha-256 & sha-512 multihash implementations

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.7K
increased by44.1%
Maintainers
1
Weekly downloads
 
Created
Source

sync-multihash-sha2

Library provides alternative implementation of sha256 and sha512 hashing algorithms for those rare cases where implementation provided by multiformats may be prohibitively slow.

ℹ️ In vast majority of use cases multiformats is better choice. In rare instances where multiformats does not meet your requirements you could use this library, but please make sure to consider the offered tradeoffs.

Tradeoffs

tl;dr: This implementation has sync API and is faster in browsers, but more dependencies implies more bytes over the wire and greater risk of supply chain attacks.

💚 Faster & Sync

Library provides SyncMultihashHasher implementation which provides sync API in browser and node environments. This is accomplished by leveraging node:crypto in node and in @noble/hashes in browsers.

  • It can can be used in synchronous code paths
  • It significantly faster in browsers

💔 More dependencies

Since this library does not leverage web crypto APIs there is more code to be send over the wire. More dependencies also increase risk of supply chain attacks.

💔 Less future proof

Web crypto APIs deliberately provide async APIs, which this library provides sync API. Furthermore, native implementation appears significantly slower, possibly because browsers rate-limit API calls.

Difference in choices may prove problematic in longer.

Keywords

FAQs

Package last updated on 06 Jul 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc