Самый простой генератор паролей на JavaScript. Внизу вы можете увидеть исходники генератора.
| Советы |
|
Самый простой генератор паролей на JavaScript. Внизу вы можете увидеть исходники генератора.
| Советы |
|
function generatePassword() {
var length = 8;
var count = 20;
var pass = "";
var allpass = "";
var special = false;
var digits = true;
var lower = true;
var upper = true;
length = document.hgmPassGenForm.length.value;
count = document.hgmPassGenForm.count.value;
if (!isNumber(length)) {
document.hgmPassGenForm.length.focus();
return false;
}
if (!isNumber(count)) {
document.hgmPassGenForm.count.focus();
return false;
}
special = Boolean(document.hgmPassGenForm.special.checked);
digits = Boolean(document.hgmPassGenForm.digits.checked);
lower = Boolean(document.hgmPassGenForm.lower.checked);
upper = Boolean(document.hgmPassGenForm.upper.checked);
var aSpecial = "!@#$%^&*_=-+."; /* ,.:;_= */
var aDigits = "0123456789";
var aLower = "abcdefghijklmnopqrstuvwxyz";
var aUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var aFull = "";
if (lower) {
aFull = aFull + aLower; }
if (upper) {
aFull = aFull + aUpper; }
if (digits) {
aFull = aFull + aDigits; }
if (special) {
aFull = aFull + aSpecial; }
var fullLen = aFull.length;
if (fullLen==0) {
document.hgmPassGenForm.result.value = "Веберите хоть что-то!";
document.hgmPassGenForm.result.className = 'passgen-error';
setTimeout("document.hgmPassGenForm.result.className = '';",2000);
return false;
}
for (j=1; j <= count; j++) {
pass = "";
for (i=0; i < length; i++) {
pass = pass + aFull[getRandom(fullLen)];
}
allpass = allpass + String(j) + ". " + pass + "\n";
}
document.getElementById('passes').value = allpass;
document.hgmPassGenForm.passes.value = allpass;
return true;
}
function checkLength() {
obj = document.hgmPassGenForm.length;
if (!isNumber(obj.value)) {
obj.className = "passgen-error";
return false;
}
obj.className = "";
return true;
}
function getRandom(max) {
var rnd = Math.random();
rnd = parseInt(rnd * max);
return rnd;
}
function isNumber(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}
Метки: generationpassgenpasswordpasswordsгенераторинструментымоёпарольсгенерировать
06.11.2019
23.09.2019
31.10.2016
27.05.2020
09.04.2020
Проблемное обновление (KB4534310)
11.02.2020
30.01.2020
CMW – Комплекс обслуживания рабочих станций
04.02.2016
“Пока” нежелательное обновление KB4516065
06.11.2019
Запустить свой сервер Minecraft
24.01.2016
06.01.2016
Запустить свой сервер Unturned
20.07.2016