aboutsummaryrefslogtreecommitdiffstats
path: root/sha1pass
diff options
context:
space:
mode:
Diffstat (limited to 'sha1pass')
-rwxr-xr-xsha1pass4
1 files changed, 3 insertions, 1 deletions
diff --git a/sha1pass b/sha1pass
index 26ea76bc..3be2dbc1 100755
--- a/sha1pass
+++ b/sha1pass
@@ -26,7 +26,9 @@ sub random_bytes($) {
($pass, $salt) = @ARGV;
-$salt = $salt || MIME::Base64::encode(random_bytes(6), '');
+unless (defined($salt)) {
+ $salt = MIME::Base64::encode(random_bytes(6), '');
+}
$pass = Digest::SHA1::sha1_base64($salt, $pass);
print '$4$', $salt, '$', $pass, "\$\n";