title: Decode base64 with white space
body: <p>I have a base64 encoded string i'm trying to decrypt with go. The string contains white spaces which should be ignored.
  A sample code I'm trying:</p>
  
  <pre><code>s := "eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjEzZmU3MWQ0LWQxMGQtNDIyMC1hMjE2LTIwMDZkMWRkNGNiOCIsImFjc1RyY++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++W5zSUQiOiJkN2M0NWY5OS05NDc4LTQ0YTYtYjFmMi0xMDAwMDAwMDMzNjYiLCJtZXNzYWdlVHlwZSI6IkNSZXEiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMS4wIiwiY2hhbGxlbmdlV2luZG93U2l6ZSI6IjAyIn0%3D"
  
  out, err := base64.URLEncoding.DecodeString(s)
  if err != nil {
      fmt.Println(err)
      return
  }
  fmt.Println(string(out))
  </code></pre>
  
  <p>This code returns: </p>
  
  <blockquote>
    <p>illegal base64 data at input byte 93</p>
  </blockquote>
  
  <hr>
  
  <p>After changing the string padding, and using StdEncoding instead of URLEncoding:</p>
  
  <pre><code>s= strings.Replace(s, "%3D", "=", -1)
  out, err := base64.StdEncoding.DecodeString(s)
  if err != nil {
      fmt.Println(err)
      return
  }
  fmt.Println(string(out))
  </code></pre>
  
  <p>The output will be: </p>
  
  <blockquote>
    <p>{"threeDSServerTransID":"13fe71d4-d10d-4220-a216-2006d1dd4cb8","acsTrc���������������������������������������������������������������������������nsID":"d7c45f99-9478-44a6-b1f2-100000003366","messageType":"CReq","messageVersion":"2.1.0","challengeWindowSize":"02"}</p>
  </blockquote>
  
  <hr>
  
  <p>How can I decrypt the string correctly?</p>