JSPM

crypto-randomuuid

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 3147488
    • Score
      100M100P100Q204173F
    • License MIT

    Polyfill crypto.randomUUID

    Package Exports

    • crypto-randomuuid

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (crypto-randomuuid) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    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

    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