def human_size(nbytes):
    """ Convert size in bytes to a human readable representation.

        Args:
            nbytes (int): Size in bytes.

        Returns:
            Human friendly string representation of ``nbytes``, unit is power
            of 1024.

        >>> human_size(65425721)
        '62.39 MiB'
        >>> human_size(0)
        '0.00 B'

    """
    for unit in ['', 'ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']:
        if abs(nbytes) < 1024.0:
            return "{:.2f} {}B".format(nbytes, unit)
        nbytes /= 1024.0
    return "{:.2f} {}B".format(nbytes, 'Yi')