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'];

  //随机产生

  if ( randomFlag ) {

    range = Math.round( Math.random( ) * ( max-min)) + min;

  }

  for ( var i=0; i<range;i++ ) {

    pos = Math.round(Math.random( ) * (arr.length-1));

    str += arr [pos]

    console.log( str )

    return str;

}

randomWord(false,32)        //220b4eac9068d368a639d62eeaf5cb59

randomWord(true,3,32)  //tesa87sd34s

相关文章:

  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2022-02-06
  • 2021-07-05
猜你喜欢
  • 2022-12-23
  • 2021-05-19
  • 2022-12-23
  • 2021-10-31
  • 2022-12-23
  • 2022-03-02
  • 2021-11-29
相关资源
相似解决方案