123456789101112131415161718192021 |
/** * Randomword produces random alphanumeric combinations of any length* * randomflag-whether any length min-any length minimum bit [fixed number] max-any length maximum bit* * Xuanfeng 2014-08-28*/ function randomword(randomflag, min, max){ var str = "", range = min, Arr = [' 0 ', ' 1 ', ' 2 ', ' 3 ', ' 4 ', ' 5 ', ' 6 ', ' 7 ', ' 8 ', ' 9 ', A, ' B ', C, ' d ', E, ' F ', ' G ', ' H ', I, ' J ', K, L, ' m ', N, ' O ', ' P ', ' Q ', ' R ', ' s ', ' t ', ' U ', ' V ', ' W ', ' X ', ' Y ', ' Z ', A, B, C, D, E, F, G, H, ' I ', J, K, L, M, N, O, P, ' Q ' , ' R ' , ' s ' , ' T ' , ' U ' , ' V ' , ' W ' , ' X ' , Y ' , ' Z ' ] //randomly generated if(randomflag){ range = mathround (math.random ( * (max-min) ) + min }For (var i=0; I<range; I+ +){ pos = Mathround (math.random ( * (arrlength-1) str + = arr[pos]; } return str; } |