
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Radix sort has linear time complexity, O(kN), where k is the number of radices per value, and N is the number of values.
How is this possible? The theoretical lower bound of O(N log N) only applies to comparison-based sorting algorithms, whereas radix sort doesn't actually perform any comparisons on the input data.
var sort = radixsort(),
data = new Float32Array([…]);
var sorted = sort(data);
// You can also preallocate the auxiliary array…
sorted = sort(data, new Float32Array(data.length));
Note that radix sort modifies the input array, even though it uses an auxiliary array too. In fact, the sorted result will be the input array when an even number of radixes are in use, which is currently always the case.
The sorter always returns a buffer representing the sorted result, so you can pass this to the appropriate typed array constructor, as in the example above.
The most common usage scenario for this will probably be sorting 32-bit floats e.g. for geometry algorithms. My informal benchmark repeatedly sorts an array of 65,536 random 32-bit floats.
Of course, the comparison is not entirely fair as JavaScript's native sort will be sorting double-precision (64-bit) numbers, as this is all JavaScript supports. But 32 bits is sufficient for most geometry algorithms, so the comparison is reasonable.
Radixsort.js is roughly 16x faster! The speed difference gets even larger as you increase the input size.
FAQs
Blazingly fast radix sort in JavaScript for typed arrays.
The npm package radixsort receives a total of 0 weekly downloads. As such, radixsort popularity was classified as not popular.
We found that radixsort demonstrated a not healthy version release cadence and project activity because the last version was released 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.