(value, num_bits)
return ''.join(chr(byte_at(offset)) for offset in shifts)
Convert an integer to a big-endian string of bytes with padding.

    Padding is added at the end (i.e. after the least-significant bit) if
    required.
Convert an integer to a big-endian string of bytes with padding.
Convert an integer to a big - endian string of bytes with padding .
def _to_byte_string(value, num_bits):
    """Convert an integer to a big-endian string of bytes with padding.

    Padding is added at the end (i.e. after the least-significant bit) if
    required.
    """
    shifts = six.moves.xrange(num_bits - 8, -8, -8)
    byte_at = lambda off: ((value >> off  # noqa: E731
                            if off >= 0 else value << -off) & 0xff)
    return ''.join(chr(byte_at(offset)) for offset in shifts)
def _to_byte_string ( value , num_bits ) : shifts = six . moves . xrange ( num_bits - 8 , - 8 , - 8 ) byte_at = lambda off : ( ( value >> off # noqa: E731 if off >= 0 else value << - off ) & 0xff ) return '' . join ( chr ( byte_at ( offset ) ) for offset in shifts )