def _b64(b):
 return base64.urlsafe_b64encode(b).decode('utf8').replace('=', '')

def _b64 ( b ) : return base64 . urlsafe_b64encode ( b ) . decode ( 'utf8' ) . replace ( '=' , '' )
helper function base64 encode for jose spec .