def readu16(fd, loc=None):
    """
    Read an unsigned 16-bit number
    :param fd: file handle
    :param loc: seek location
    :return: a 4-byte number
    """
    if loc is not None:
        fd.seek(loc)
    data = fd.read(4)
    return data[0] + 256 * data[1]
