Przeglądaj źródła

Limit password to characters or numbers

This avoids crazy characters which are hard to type
Bob Mottram 8 lat temu
rodzic
commit
a08f0b52d1
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1
    1
      src/freedombone-utils-passwords

+ 1
- 1
src/freedombone-utils-passwords Wyświetl plik

51
 }
51
 }
52
 
52
 
53
 function create_password {
53
 function create_password {
54
-    echo "$(openssl rand -base64 32 | cut -c1-${1})"
54
+    openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c ${1} ; echo ''
55
 }
55
 }
56
 
56
 
57
 # NOTE: deliberately no exit 0
57
 # NOTE: deliberately no exit 0