def b16decode(s, casefold=False):
 if casefold:
  s = s.upper()
 if re.search('[^0-9A-F]', s):
  raise TypeError('Non-base16 digit found')
 return binascii.unhexlify(s)

def b16decode ( s , casefold = False ) : if casefold : s = s . upper ( ) if re . search ( '[^0-9A-F]' , s ) : raise TypeError ( 'Non-base16 digit found' ) return binascii . unhexlify ( s )
decode a base16 encoded string .