New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ulidx

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ulidx - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

12

dist/ulid.js

@@ -55,11 +55,14 @@ "use strict";

var rootLookup = root || detectRoot();
var webCrypto = (rootLookup && (rootLookup.crypto || rootLookup.msCrypto)) ||
var globalCrypto = (rootLookup && (rootLookup.crypto || rootLookup.msCrypto)) ||
(typeof crypto !== "undefined" ? crypto : null);
if (webCrypto) {
if (typeof (globalCrypto === null || globalCrypto === void 0 ? void 0 : globalCrypto.getRandomValues) === "function") {
return function () {
var buffer = new Uint8Array(1);
webCrypto.getRandomValues(buffer);
globalCrypto.getRandomValues(buffer);
return buffer[0] / 0xff;
};
}
else if (typeof (globalCrypto === null || globalCrypto === void 0 ? void 0 : globalCrypto.randomBytes) === "function") {
return function () { return globalCrypto.randomBytes(1).readUInt8() / 0xff; };
}
else {

@@ -83,2 +86,5 @@ try {

}
if (typeof global !== "undefined") {
return global;
}
return null;

@@ -85,0 +91,0 @@ }

{
"name": "ulidx",
"version": "0.2.0",
"version": "0.3.0",
"description": "ULID generator for NodeJS and the browser",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

# ulidx
> ULID generator for NodeJS and the browser
[![ulidx](https://img.shields.io/npm/v/ulidx?color=blue&label=ulidx&logo=npm&style=flat-square)](https://www.npmjs.com/package/ulidx)
[![ulidx](https://img.shields.io/npm/v/ulidx?color=blue&label=ulidx&logo=npm&style=flat-square)](https://www.npmjs.com/package/ulidx) ![Tests status](https://github.com/perry-mitchell/ulidx/actions/workflows/test.yml/badge.svg)

@@ -78,5 +78,8 @@ ULID generator library, based off of the original [ulid](https://github.com/ulid/javascript) for NodeJS and the browser. ULIDs are Universally Unique Lexicographically Sortable Identifiers. This library adheres to [this specification](https://github.com/ulid/spec).

* NodeJS 10 and up
* Node REPL
* Browsers with working `crypto` / `msCrypto` libraries
* Web workers
`ulidx` is _not_ compatible with Cloudflare Workers due to their [problematic stance on getting the current time](https://developers.cloudflare.com/workers/learning/security-model#step-1-disallow-timers-and-multi-threading).
### Web

@@ -83,0 +86,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc