From 2e84588ec83b453e9c1a667841200b7d77260621 Mon Sep 17 00:00:00 2001 From: foswret Date: Sun, 22 Jun 2025 15:05:58 -0500 Subject: removed un-needed comments --- README.md | 15 +++++++++------ password.c | 44 +++++++++++++++++++------------------------- 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 8443079..8cd127c 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,16 @@ -This is a simple password generator that I created because I was tired of thinking up of passwords. All randomness is produced by the [libsodium](https://github.com/jedisct1/libsodium) library. +# SPWDG +This is a simple password generator written in C. All randomness is produced by the [libsodium](https://github.com/jedisct1/libsodium) library. + ## Dependencies -- `make` -- `libsodium` +- gcc +- make +- libsodium ## Install -- `make` -- `sudo make install` +- make +- sudo make install ## Uninstall -- `sudo make uninstall` +- sudo make uninstall diff --git a/password.c b/password.c index 9912e5d..7cd6da9 100644 --- a/password.c +++ b/password.c @@ -1,35 +1,34 @@ #include #include -#include #include #include #include //To Upper -long count_lines(FILE *File) { // Accepts file as input +long count_lines(FILE *File) { char c; long line_counter = 0; while ((c = getc(File)) != EOF) { if (c == '\n') { - line_counter++; // Increment when each line number is passed + line_counter++; } } - return(line_counter); // Return the found value + return(line_counter); } void randomize_case(char *a) { // Accepts a string as input - for (int i = 0; i < strlen(a); i++) { // Loop through the length of the string + for (int i = 0; i < strlen(a); i++) { int coin = randombytes_uniform(2); // Decide if the current character will be capitalized or lowercase if (coin == 1) { - a[i] = toupper(a[i]); // Change current character into a capital + a[i] = toupper(a[i]); } } } -void generate_integers(void) { // Generates a string of random integers +void generate_integers(void) { int length = 5; // TO-DO: Make random eventually for (int i=0; i