code: def makeB64UrlSafe(b64str):
      
      if isinstance(b64str, six.text_type):
          b64str = b64str.encode()
      # see RFC 4648, sec. 5
      return b64str.replace(b'+', b'-').replace(b'/', b'_')
docs: Make a base64 string URL Safe