add: specs & database status

This commit is contained in:
2024-05-08 21:56:23 +02:00
parent 8f47633e86
commit 27e9e2d941
12 changed files with 472 additions and 80 deletions

27
utils/name-generator.ts Normal file
View File

@@ -0,0 +1,27 @@
var nameList = [
'Time', 'Past', 'Future', 'Dev',
'Fly', 'Flying', 'Soar', 'Soaring', 'Power', 'Falling',
'Fall', 'Jump', 'Cliff', 'Mountain', 'Rend', 'Red', 'Blue',
'Green', 'Yellow', 'Gold', 'Demon', 'Demonic', 'Panda', 'Cat',
'Kitty', 'Kitten', 'Zero', 'Memory', 'Trooper', 'XX', 'Bandit',
'Fear', 'Light', 'Glow', 'Tread', 'Deep', 'Deeper', 'Deepest',
'Mine', 'Your', 'Worst', 'Enemy', 'Hostile', 'Force', 'Video',
'Game', 'Donkey', 'Mule', 'Colt', 'Cult', 'Cultist', 'Magnum',
'Gun', 'Assault', 'Recon', 'Trap', 'Trapper', 'Redeem', 'Code',
'Script', 'Writer', 'Near', 'Close', 'Open', 'Cube', 'Circle',
'Geo', 'Genome', 'Germ', 'Spaz', 'Shot', 'Echo', 'Beta', 'Alpha',
'Gamma', 'Omega', 'Seal', 'Squid', 'Money', 'Cash', 'Lord', 'King',
'Duke', 'Rest', 'Fire', 'Flame', 'Morrow', 'Break', 'Breaker', 'Numb',
'Ice', 'Cold', 'Rotten', 'Sick', 'Sickly', 'Janitor', 'Camel', 'Rooster',
'Sand', 'Desert', 'Dessert', 'Hurdle', 'Racer', 'Eraser', 'Erase', 'Big',
'Small', 'Short', 'Tall', 'Sith', 'Bounty', 'Hunter', 'Cracked', 'Broken',
'Sad', 'Happy', 'Joy', 'Joyful', 'Crimson', 'Destiny', 'Deceit', 'Lies',
'Lie', 'Honest', 'Destined', 'Bloxxer', 'Hawk', 'Eagle', 'Hawker', 'Walker',
'Zombie', 'Sarge', 'Capt', 'Captain', 'Punch', 'One', 'Two', 'Uno', 'Slice',
'Slash', 'Melt', 'Melted', 'Melting', 'Fell', 'Wolf', 'Hound',
'Legacy', 'Sharp', 'Dead', 'Mew', 'Chuckle', 'Bubba', 'Bubble', 'Sandwich', 'Smasher', 'Extreme', 'Multi', 'Universe', 'Ultimate', 'Death', 'Ready', 'Monkey', 'Elevator', 'Wrench', 'Grease', 'Head', 'Theme', 'Grand', 'Cool', 'Kid', 'Boy', 'Girl', 'Vortex', 'Paradox'
];
export function generateName(): string {
return nameList[Math.floor(Math.random() * nameList.length)] + "-" + nameList[Math.floor(Math.random() * nameList.length)];
}

View File

@@ -0,0 +1,33 @@
let special = "!@$&*()_+";
let digits = "0123456789";
let letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
interface PasswordGeneratorConfiguration {
length?: number;
numberOfDigits?: number;
numberOfSpecialCharacters?: number;
}
export function generatePassword({ length = 16, numberOfDigits = 2, numberOfSpecialCharacters = 4 }: PasswordGeneratorConfiguration): string {
let password = "";
for (let i = 0; i < length - numberOfDigits - numberOfSpecialCharacters; i++) {
const randomIndex = Math.floor(Math.random() * length);
const randomLetter = Math.floor(Math.random() * letters.length);
password = password.slice(0, randomIndex) + letters[randomLetter] + password.slice(randomIndex);
}
for (let i = 0; i < numberOfDigits; i++) {
const randomIndex = Math.floor(Math.random() * length);
const randomDigit = Math.floor(Math.random() * 10);
password = password.slice(0, randomIndex) + digits[randomDigit] + password.slice(randomIndex);
}
for (let i = 0; i < numberOfSpecialCharacters; i++) {
const randomIndex = Math.floor(Math.random() * length);
const randomSpecial = Math.floor(Math.random() * special.length);
password = password.slice(0, randomIndex) + special[randomSpecial] + password.slice(randomIndex);
}
return password;
}