Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

commenting and whitespace management

  • Loading branch information...
commit f0404812da0c1c00fb71a058612e86bfc6edd374 1 parent 31cdf29
@tenorviol authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 passgen
View
9 passgen
@@ -2,15 +2,20 @@
# create a random password 10 characters long
+# TODO: accept -n password length parameter
+# TODO: accept character set parameter
+
$set = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz0123456789!@$%^*_";
#$set = "ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz123456789_";
$length = 10;
open RAND, "/dev/random";
+# TODO: check that open RAND succeeded
+
for ($i = 0; $i < $length; $i++) {
- read RAND, $ch, 1;
- print substr($set, ord($ch) % length($set), 1);
+ read RAND, $ch, 1;
+ print substr($set, ord($ch) % length($set), 1);
}
close RAND ;
Please sign in to comment.
Something went wrong with that request. Please try again.