
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
A highly performant unique identifier generator.
Use the npm
command:
$ npm install js-nuid
<script src="../index.js"></script>
<script>
n = new nuid.Nuid();
for (let i = 0; i < 10; i++) {
let pre = document.createElement("pre");
let t = document.createTextNode(n.next());
pre.appendChild(t);
document.body.appendChild(pre);
}
</script>
NUID needs to be very fast to generate and be truly unique, all while being entropy pool friendly. NUID uses 12 bytes of crypto generated data (entropy draining), and 10 bytes of pseudo-random sequential data that increments with a pseudo-random increment.
Total length of a NUID string is 22 bytes of base 36 ascii text, so 36^22 or 17324272922341479351919144385642496 possibilities.
The library uses crypto
to generate random numbers. Current support for crypto
can be found here: https://caniuse.com/#search=crypto.
If you want to target other browsers, you can shim an implementation of crypto.getRandomValues()
such as the one below. However your performance and entropy will vary.
window.crypto.getRandomValues = function(array) {
for(let i=0; i < array.length; i++) {
array[i] = Math.floor(Math.random() * (255));
}
};
Our support policy for Nodejs versions follows Nodejs release support. We will support and build node-nats on even-numbered Nodejs versions that are current or in LTS.
Unless otherwise noted, the NATS source files are distributed under the Apache Version 2.0 license found in the LICENSE file.
FAQs
Nuid for javascript
The npm package js-nuid receives a total of 18 weekly downloads. As such, js-nuid popularity was classified as not popular.
We found that js-nuid 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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.