Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created December 21, 2019 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/a6e96ccb4befff0f040f5e37a5087fc1 to your computer and use it in GitHub Desktop.
Save parzibyte/a6e96ccb4befff0f040f5e37a5087fc1 to your computer and use it in GitHub Desktop.
void cadena_aleatoria(int longitud, char *destino) {
char muestra[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
for (int x = 0; x < longitud; x++) {
int indiceAleatorio = aleatorio_en_rango(0, (int) strlen(muestra) - 1);
destino[x] = muestra[indiceAleatorio];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment