diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3ac0c91..3b70aad 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,4 +20,5 @@ - Reysekha - igrzhukovich - CinnamonXI -- AkasakaID \ No newline at end of file +- AkasakaID +- JastinXyz diff --git a/src/Javascript/makeId.js b/src/Javascript/makeId.js new file mode 100644 index 0000000..c4bdff3 --- /dev/null +++ b/src/Javascript/makeId.js @@ -0,0 +1,11 @@ +const string = "ABCDEFGHIJKLMNOPQRSTUVFXYZabcdefghijklmnopqrstuvwxyz1234567890" +function makeId(number = 8) { + let result = ""; + const charlength = string.length; + for(let i = 0; i < number; i++) { + result += string.charAt(Math.floor(Math.random() * charlength)); + } + return result; +} + +console.log(makeId(10))