(size)
| 357 | } |
| 358 | |
| 359 | function randomString(size) { |
| 360 | size = size || 6; |
| 361 | var code_string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; |
| 362 | var max_num = code_string.length + 1; |
| 363 | var new_pass = ''; |
| 364 | while (size > 0) { |
| 365 | new_pass += code_string.charAt(Math.floor(Math.random() * max_num)); |
| 366 | size--; |
| 367 | } |
| 368 | return new_pass; |
| 369 | } |