Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

368
Visualizações
How can I Random A-Z JavaScript?

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

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

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.

about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda