Last active
May 16, 2023 17:34
-
-
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)
This file contains hidden or 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 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