Created
July 10, 2022 14:48
-
-
Save bennotti/42507f943faf8c02d82e52fba463317c to your computer and use it in GitHub Desktop.
[typescript] gerar 12 palavras aleatorias de 6 caracteres cada
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
| const chunkString = (valor: string, tamanho: number): Array<string> => { | |
| return valor.match(new RegExp('.{1,' + tamanho + '}', 'g')) as Array<string>; | |
| } | |
| const valor3uuid = 'bd08927cd4714fc6b8fb63d8061096c0a7eae0975910406089714028e57062d074d74b7acef344aebab676d1d08d925f'; | |
| const listaPalavras = chunkString((valor3uuid).substring(0, 72), 6); | |
| console.log(listaPalavras); | |
| console.log(listaPalavras.join(' ')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment