
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
@dsnp/hash-util
Advanced tools
This package is a TypeScript implementation of hash-related utilities to support DSNP applications and services.
DSNP anchors content to announcements via a URL and hashes. This ensures integrity of resources and also provides for relocatable content, as hashes can be generated and verified regardless of location.
This library provides a simple implementation that checks whether a data "file" matches at least one of the hash values provided.
This library utilizes a number of open source projects and the authors are grateful for the efforts of the following projects:
Given a Uint8Array and an array of strings representing DSNP hashes, use the following function to verify if there is a matching hash.
import { compareBinaryToMultibaseHashes } from "@dsnp/hash-util";
const result = await compareBinaryToMultibaseHashes(binaryU8A, hashes);
It can also be used to generate the CID for a Uint8Array (this is used internally in compareBinaryToMultibaseHashes):
import { generateCID } from "@dsnp/hash-util";
const cidString = await generateCID(binaryU8A);
The library will verify the following types of hashes:
base32 or base58btcsha2-256 or blake2b-256 hashipfs add --cid-version=1 ...
base32 base encodingdag-pb codec for input longer than 256*1024 bytesraw codec for shorter (single-block) inputsha2-256 hashAll comparisons are done in-memory, meaning that there is no attempt to limit the size of the byte array or memory requirements. Callers should therefore perform their own sanity checks.
npm i
npm run build
npm run test
Please use the github issues area to report bugs or suggest enhancements. Pull requests are gratefully welcomed.
FAQs
A library to verify hashes compatible with DSNP
The npm package @dsnp/hash-util receives a total of 0 weekly downloads. As such, @dsnp/hash-util popularity was classified as not popular.
We found that @dsnp/hash-util demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
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.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.