Skip to content

Instantly share code, notes, and snippets.

@rafaelcbc
Last active May 16, 2023 17:34
Show Gist options
  • Select an option

  • Save rafaelcbc/bad1caf4e54487febe1ef31aea16f778 to your computer and use it in GitHub Desktop.

Select an option

Save rafaelcbc/bad1caf4e54487febe1ef31aea16f778 to your computer and use it in GitHub Desktop.
Função JS para gerar um valor em hexadecimal de 8 bytes aleatório e preencher os campos da tela com esse valor (utilizar no console do DevTools)
function gera_id() {
return parseInt((Math.random() * 0xFFFFFFFFFFFFFFFF))
.toString(16)
.padEnd(16, '0');
}
function preencheCampos(totalcampos) {
for (let index = 0; index < totalcampos; index++) {
id = gera_id()
$$('.rfid_list')[index].value = id
console.log(id)
}
}
preencheCampos(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment