Created
August 10, 2022 15:53
-
-
Save epireve/dc7170d362bb01e65daaf90968345f2f to your computer and use it in GitHub Desktop.
Generate 16 alphanumerics license JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generatelicense() { | |
var result = ''; | |
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; | |
var charactersLength = characters.length; | |
for (var i = 0; i < 16; i++) { | |
result += characters.charAt(Math.floor(Math.random() * charactersLength)); | |
if (i === 3 || i === 7 || i === 11) { | |
result += '-'; | |
} | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment