Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qard/crypto-randomuuid
Polyfill crypto.randomUUID
https://github.com/qard/crypto-randomuuid
Last synced: 12 days ago
JSON representation
Polyfill crypto.randomUUID
- Host: GitHub
- URL: https://github.com/qard/crypto-randomuuid
- Owner: Qard
- Created: 2021-08-09T18:20:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-09T19:19:52.000Z (over 3 years ago)
- Last Synced: 2024-10-19T19:55:35.325Z (about 1 month ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# crypto-randomuuid
This is a polyfill for the `crypto.randomUUID` method in Node.js. It will use
the built-in version, if present. There are plenty of other uuid modules, but
this one aims to be as functionally identical as possible to the Node.js core
function.This uses a pure JavaScript replacement of the `secureBuffer` function using
`randomFillSync` rather than the native version using `OPENSSL_secure_malloc`
in Node.js core. This may have security implications, so I'd recommend against
using this anywhere that cryptographically secure uuids are important.## Install
```sh
npm install crypto-randomuuid
```## Usage
https://nodejs.org/api/crypto.html#crypto_crypto_randomuuid_options
## License
This is all copy/pasted from Node.js core, so see the license there: https://github.com/nodejs/node/blob/master/LICENSE