
Oslo Has Free Crypto & Auth Utilities for TypeScript — Here's How to Use Them
Rolling your own crypto is dangerous. Using Node.js crypto directly is verbose and error-prone. Oslo provides battle-tested utilities for hashing, encoding, random generation, and more. What Is Oslo? Oslo is a collection of lightweight TypeScript packages for common security operations. Created by the same team behind Lucia and Arctic, it's designed for developers who need simple, correct crypto primitives. Packages Oslo is modular — install only what you need: npm install @oslojs/crypto # Hashing, HMAC, RSA npm install @oslojs/encoding # Base64, hex, base32 npm install @oslojs/jwt # JWT creation and validation npm install @oslojs/otp # TOTP/HOTP for 2FA npm install @oslojs/oauth2 # OAuth 2.0 utilities Password Hashing import { hash , verify } from " @oslojs/crypto/sha256 " ; import { encodeHexLowerCase } from " @oslojs/encoding " ; // For password hashing, use argon2 or bcrypt instead // Oslo SHA-256 is for data integrity, not passwords import { hashPassword , verifyPassword } from "
Continue reading on Dev.to Webdev
Opens in a new tab

