def B64HexEncode(s, padding=True):
 encoded = base64.b64encode(s)
 translated = encoded.translate(_std_to_b64hex)
 if padding:
  return translated
 else:
  return translated.rstrip('=')

def B64HexEncode ( s , padding = True ) : encoded = base64 . b64encode ( s ) translated = encoded . translate ( _std_to_b64hex ) if padding : return translated else : return translated . rstrip ( '=' )
encode a string using base64 with extended hex alphabet .