def prefix_encode(a, b):
 i = first_diff(a, b)
 return (chr(i) + b[i:].encode('utf8'))

def prefix_encode ( a , b ) : i = first_diff ( a , b ) return ( chr ( i ) + b [ i : ] . encode ( 'utf8' ) )
compresses string b as an integer representing the prefix it shares with a .