Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

quickid

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quickid - npm Package Compare versions

Comparing version
1.0.3
to
1.0.4
+17
index.js
const getRandomIndex = (max) => Math.floor(Math.random() * max);
const generate = (length = 8) => {
const characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
let result = '';
for (let i = 0; i < length; i++) {
const randomIndex = getRandomIndex(characters.length);
result += characters.charAt(randomIndex);
}
return result;
};
module.exports = {
generate,
};
+2
-4
{
"name": "quickid",
"version": "1.0.3",
"version": "1.0.4",
"description": "Quick ID is a lightweight and efficient npm package designed to generate unique and random IDs effortlessly. With simplicity in mind, Quick ID provides a single function, quickId(), which returns a randomly generated alphanumeric string of a specified length.",

@@ -19,5 +19,3 @@ "main": "index.js",

"license": "ISC",
"dependencies": {
"typescript": "^5.3.3"
}
"dependencies": {}
}
function getRandomIndex(max: number): number {
return Math.floor(Math.random() * max);
}
export function generate(length: number = 8): string {
const characters: string = 'abcdefghijklmnopqrstuvwxyz0123456789';
let result: string = '';
for (let i: number = 0; i < length; i++) {
const randomIndex: number = getRandomIndex(characters.length);
result += characters.charAt(randomIndex);
}
return result;
}
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"strict": true
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
}