I have a problem with Lua obfuscator which uses Java Script and I want to modify it from name(num) to random a-z(num)
This is the line in question : https://codeshare.io/X8XBbo Me + makeid which is Random A-Z but when i did it it doesn't work i don't know what i did wrong please help me i am newbie
Code = https://codeshare.io/RboW0E My error is at lines 1-10 = makeid function and 30 = procress line
Your random ID generator works:
function makeid(length) {
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;
for ( var i = 0; i < length; i++ ) {
result += characters.charAt(Math.floor(Math.random() *
charactersLength));
}
return result;
}
console.log(makeid(5))
There's a comma after the function on line 12. Remove that and put the second function on a new line.
Also it seems like there's more code after what you shared since your second function doesn't close, so aside from the comma, I can't tell what could be causing issues.
Did you change your variable names to letters for the sake of the question? If not, I'd recommend you use more explanatory variables names. It makes the code easier for you and others to understand.
I personally also feel that the comma separated declarations are a bit harder to follow.
If you're getting into JS, check out the Airbnb style guide for some good syntax rules to follow.