1. uncrypto
Single API for Web Crypto API and Crypto Subtle working in Node.js, Browsers and other runtimes
uncrypto
Package: uncrypto
Created by: unjs
Last modified: Tue, 06 Jun 2023 20:31:02 GMT
Version: 0.1.3
License: MIT
Downloads: 3,824,040
Repository: https://github.com/unjs/uncrypto

Install

npm install uncrypto
yarn add uncrypto

uncrypto

npm version
npm downloads
Github Actions
Codecov

This library provides a single api to use web-crypto and Subtle Crypto in both Node.js using Crypto Module and Web targets using Web Crypto API using Conditional Exports.

Requirements:

  • Node.js: Version 15 and above (this library provides no polyfills for older versions!)
  • Browser: Secure Context (HTTPS/Localhost) in Supported Browsers
  • Other Runtimes: Exposed globalThis.crypto and globalThis.crypto.subtle. (you can polyfill if neeeded)

Usage

Install package:

 # npm
npm install uncrypto

# yarn
yarn add uncrypto

# pnpm
pnpm install uncrypto

Import:

 // ESM
import { subtle, randomUUID, getRandomValues } from "uncrypto";

// CommonJS
const { subtle, randomUUID, getRandomValues } = require("uncrypto");

Development

  • Clone this repository
  • Install latest LTS version of Node.js
  • Enable Corepack using corepack enable
  • Install dependencies using pnpm install
  • Run interactive tests using pnpm dev

License

Made with 💛

Published under MIT License.

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin