Created
June 7, 2012 10:30
-
-
Save tobin/2888087 to your computer and use it in GitHub Desktop.
Random password generator
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <time.h> | |
| char charset[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~!@#$%^&*-+="; | |
| int main(int argc, char **argv) { | |
| srand(time(NULL)); | |
| for (int i=0; i<10; i++) | |
| printf("%c", charset[rand() % sizeof(charset)]); | |
| printf("\n"); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
LinkedIn password hacked?