
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
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 14 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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.