parity demonstrates adding parity bits to a string

parity.py

parity.even(s)

Convert a byte string in to an even parity byte string (number of one-bits in each character is even)

example::
parity.even(b’test’) b’teót’
Parameters:s (bytes) – String to convert.
Returns:Same string but with even parity applied.
Return type:bytes
parity.odd(s)

Convert a byte string in to an odd parity byte string (number of one-bits in each character is odd)

example::
parity.odd(b’test’) b’ôåsô
Parameters:s (bytes) – String to convert.
Returns:Same string but with odd parity applied.
Return type:bytes