code: def rand_hexstr(length, lower=True):
      
      if lower:
          return rand_str(length, allowed=CHARSET_HEXSTR_LOWER)
      else:
          return rand_str(length, allowed=CHARSET_HEXSTR_UPPER)
docs: Gererate fixed-length random hexstring, usually for md5.
  
      :param length: total length of this string.
      :param lower: use lower case or upper case.