Skip to content

Instantly share code, notes, and snippets.

@bennotti
Created July 10, 2022 14:48
Show Gist options
  • Select an option

  • Save bennotti/42507f943faf8c02d82e52fba463317c to your computer and use it in GitHub Desktop.

Select an option

Save bennotti/42507f943faf8c02d82e52fba463317c to your computer and use it in GitHub Desktop.
[typescript] gerar 12 palavras aleatorias de 6 caracteres cada
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