def hi_to_lo(octets):
    """Reads the given octets as a big-endian value. The function name comes
    from how such values are described in the packet format spec."""
    result = 0
    for octet in octets:
        result = (result << 8) + octet
    return result
