There have been many brute-force databases recently, and password security has become a major issue! How can we avoid simple passwords? Still thinking about passwords? No
I have prepared a password generation tool consisting of 0-9 and a-k English letters. The numbers are in disorder. Replace a random number with a letter to generate a password of 10.
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML xmlns = "http://www.w3.org/1999/xhtml">
How to sort arrays in disorder is a poor math. After searching, input such a function to the array sort.
Sort is really powerful.
Function unorderedarray (array) {If (({}). tostring. call (array ). indexof ('array') =-1) return; var arr = [], value = array. tostring (); arr = array. sort (function () {return math. random ()> 0.5? -;}); (ARR. tostring () === value) & arguments. callee (array); Return arr ;}
When using this method, we should avoid the generation of arrays, which is the same as the input array. This is a waste of effort, because the array is of a complex type and all modifications will change. Therefore, a variable is used to cache the value of the input array = array. tostring (), and then the value of the array I generated is compared if it is relatively recursive. Ensure that the generated array is not sequential.
Use the followingCodeGenerate a random number 0-9
Math. Random (). tofixed (1) * 10-1;
Use this serial number to get a letter from a-k, and use this letter to replace the numbers at the corresponding position of the serial number in the array.
Concatenate the obtained Array Using the join method of the array
Password. Join ('');
Obtain a key. You are welcome to use it. The blog Park will not post purely code-based posts, so there is so much nonsense. You just need to copy the code and use it directly!