def guid_to_num(guid):
    """
    Convert a DHT guid to an integer.

    Args:
        guid: The guid to convert, as a string or unicode, in
            hexadecimal.

    Returns:
        An integer corresponding to the DHT guid given.
    """
    return int(guid.rstrip('L'), base=16)