def rand_hexstr(length, lower=True):
    """Gererate fixed-length random hexstring, usually for md5.

    :param length: total length of this string.
    :param lower: use lower case or upper case.
    """
    if lower:
        return rand_str(length, allowed=CHARSET_HEXSTR_LOWER)
    else:
        return rand_str(length, allowed=CHARSET_HEXSTR_UPPER)
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 )
Gererate fixed-length random hexstring, usually for md5.

    :param length: total length of this string.
    :param lower: use lower case or upper case.