🔐 OTP Genius: Because "password123" Wasn't Cutting It
Generate OTPs so secure, even you won't remember them! Perfect for:
- Paranoid billionaires 🕶️
- Exes you don't want texting you back 💔
- That one friend who "just needs to check your Instagram real quick" 👀
🚀 Installation (Let's Get This Bread)
npm install otp-genius --save
# Pro tip: If this fails, blame your Wi-Fi. Works 60% of the time, every time.
💻 Usage (For Humans & Aliens 👽)
TypeScript (The Fancy Cousin)
import { generateOTP } from 'otp-genius';
// Basic OTP (for when you're feeling ~meh~)
const basicOTP = generateOTP(); // "835274" 🔑
// **BEAST MODE OTP** (A.K.A. "Overcompensation 101")
const godOTP = generateOTP(24, {
toLowercase: true,
toUppercase: true,
specialChar: true
});
// Example: "Qw@3zRt!8X#yLp0$Kd9^gZm&" 🦖
// Warning: May cause existential crises in hackers.
JavaScript (Old Reliable)
const generateOTP = require('otp-genius');
// OTP for your grandma's AOL account 📠
const retroOTP = generateOTP(8, {
numbers: true,
toLowercase: false,
toUppercase: false,
specialChar: false
});
// Example: "42983601" 🔢 (She'll still write it down on a Post-It)
🍕 Options Menu: Build Your OTP Like a Pizza
Option | Default | Description |
---|
length | 6 | OTP length. Choose wisely. (RIP short kings 👑) |
toLowercase | true | Adds letters (a-z) for spicy lowercase drama |
toUppercase | true | UPPERCASE LETTERS TO YELL YOUR SECURITY 🗣️ |
numbers | true | Numbers 0-9 (because 7 ate 9) 🍔 |
specialChar | true | Symbols!@#$ to confuse your cat 🐱 |
Warning: Turning off all options throws an error. Don’t be that person.
🤔 Why Our OTP Generator?
- Military-Grade Security (We watched Mr. Robot twice)
- Zero Dependencies (We don’t trust strangers, either)
- IE11 Support (Just kidding. Please upgrade your browser.)
- Free Existential Dread Included with every install!
🚨 Error Messages (For Drama Lovers)
Error: Dude, you turned off ALL the options!
→ Your OTP is now an empty void. Congrats.
Error: Invalid length!
→ You tried to generate a 1000-character OTP. Are you encrypting the Declaration of Independence?
🎁 Pro Tips (You’re Welcome)
- Forget Your Bank PIN?
generateOTP(4, { toLowercase: false, toUppercase: false, specialChar: false });
// "4298" → Close enough! 🏦💸
- Need to Impress Your Crush?
generateOTP(12, { specialChar: true });
// "L!k3$U2#mYbE" → Smooth. 😎
- Actual Advice: Don’t use "password" as your password.
👩💻 Contributing
PRs welcome if:
- You include a meme in your commit message
- You’ve bribed the maintainer with coffee ☕
- Your code passes the "Does This Break Everything?" test (Spoiler: It will.)
📜 License
This code is under the "Do Whatever, Just Don’t Sue Me" license.
Translation: Use it, fork it, print it out and eat it. IDGAF. 🍕
Final Note: If you use this package, you legally owe us a taco. 🌮
(Not really. But imagine how happy we’d be.)