
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
bit-entropy
Advanced tools
Calculates the bit-level entropy of a string or ID space given its cardinality and length.
Canonical URL:
https://alexstevovich.com/a/bit-entropy-nodejs
Software URL:
https://midnightcitylights.com/software/bit-entropy-nodejs
A utility to calculate the bit-level entropy of a string or identifier space based on its cardinality (number of unique symbols) and length.
This utility is based on information theory and provides a quick way to calculate the amount of information (in bits) that can be encoded using a string of a given length over a finite character set.
npm install bit-entropy
import { bitEntropy } from 'bit-entropy';
console.log(bitEntropy(2, 8)); // 8 bits (e.g., binary byte)
console.log(bitEntropy(16, 32)); // 128 bits (e.g., UUID v4)
console.log(bitEntropy(62, 10)); // ~59.5 bits (Base62 string of length 10)
bitEntropy(cardinality, length)Calculates the entropy in bits of a string or ID space.
cardinality (number): The number of unique symbols in the character set (e.g., 62 for Base62).length (number): The length of the string or identifier.number: The total entropy in bits.entropy = length * log2(cardinality).Licensed under the Apache License 2.0.
FAQs
Calculates the bit-level entropy of a string or ID space given its cardinality and length.
We found that bit-entropy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.