Silahkan Copas But Sertakan Sumber
function randomStringPattern (input) { var text = "" ; mungkin; for (var j = 0 ; j < input. length ; j ++ ) { if (input [j] == "" ) { mungkin = '' ; } lain jika ((input [j] == input [j]. toUpperCase ()) & & (input [j] ! = input [j]. toLowerCase ())) { mungkin = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; } lain jika ((input [j] == input [j]. toLowerCase ()) & & (input [j] ! = input [j]. toUpperCase ())) { mungkin = "abcdefghijklmnopqrstuvwxyz" ; } lain jika ( '0123456789' . indexOf (input [j]) ! == - 1 ) { mungkin = "0123456789" ; } lain { mungkin = "#! @ ~ $% ^ & *) -_" } teks + = mungkin. charAt ( Matematika . lantai ( Matematika . acak () * mungkin. panjang )); } kembalikan teks;}
1 Comments
function randomStringPattern (input) {
ReplyDeletevar text = "" ;
mungkin;
for (var j = 0 ; j < input. length ; j ++ ) {
if (input [j] == "" ) {
mungkin = '' ;
} lain jika ((input [j] == input [j]. toUpperCase ()) & & (input [j] ! = input [j]. toLowerCase ())) {
mungkin = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
} lain jika ((input [j] == input [j]. toLowerCase ()) & & (input [j] ! = input [j]. toUpperCase ())) {
mungkin = "abcdefghijklmnopqrstuvwxyz" ;
} lain jika ( '0123456789' . indexOf (input [j]) ! == - 1 ) {
mungkin = "0123456789" ;
} lain {
mungkin = "#! @ ~ $% ^ & *) -_"
}
teks + = mungkin. charAt ( Matematika . lantai ( Matematika . acak () * mungkin. panjang ));
}
kembalikan teks;
}