@staticmethod
def remainder_by_divisor(expected, divisor):
    """Shortcut to get the remainder from the expected length.
        
        Since several input formats are chunked in even, multi-bit
        blocks, sometimes ending bits need to be sliced off in order to
        reproduce the original token.
        
        The resulting remainder is that number of bits.
        
        Args:
            expected (int): Length of expected public token.
            divisor (int): Multible by which the input data format is
                chunked by.
        
        Returns:
            int: from 0 to divisor - 1.
        
        """
    mod = expected % divisor
    if mod:
        return divisor - mod
    return 0
