import base64


def Base64WSEncode(s):
  """
  Return Base64 web safe encoding of s. Suppress padding characters (=).

  Uses URL-safe alphabet: - replaces +, _ replaces /. Will convert s of type
  unicode to string type first.

  @param s: bytes to encode as Base64
  @type s: bytes

  @return: Base64 representation of s.
  @rtype: bytes
  """
  return base64.urlsafe_b64encode(s).replace(b"=", b"")