def chopstring(message, key, n, funcref):
 msglen = len(message)
 mbits = (msglen * 8)
 nbits = (bit_size(n) - 2)
 nbytes = (nbits / 8)
 blocks = (msglen / nbytes)
 if ((msglen % nbytes) > 0):
  blocks += 1
 cypher = []
 for bindex in range(blocks):
  offset = (bindex * nbytes)
  block = message[offset:(offset + nbytes)]
  value = bytes2int(block)
  cypher.append(funcref(value, key, n))
 return encode64chops(cypher)

def chopstring ( message , key , n , funcref ) : msglen = len ( message ) mbits = ( msglen * 8 ) nbits = ( bit_size ( n ) - 2 ) nbytes = ( nbits / 8 ) blocks = ( msglen / nbytes ) if ( ( msglen % nbytes ) > 0 ) : blocks += 1 cypher = [ ] for bindex in range ( blocks ) : offset = ( bindex * nbytes ) block = message [ offset : ( offset + nbytes ) ] value = bytes2int ( block ) cypher . append ( funcref ( value , key , n ) ) return encode64chops ( cypher )
chops the message into integers that fit into n .