title: URL Safe Base64 in Objective-C
body: <p>I've looked at numerous Stack Overflow posts on how to decode Base64 encoded strings in Objective C, but I'm still having issues with it.</p>
  
  <p>Essentially, I'm trying to port a Python script to Objective C.  The Python line of code is:</p>
  
  <pre><code>zlib.decompress(base64.urlsafe_b64decode(string))
  </code></pre>
  
  <p>When I run "string" through the Python version of base64.urlsafe_b64decode, it turns out correctly and can then be properly Zlib-decompressed.  When I run the "string" through any variant of an Objective C Base64 decoder, it sort of works, but the results are not the same and the Zlib decompression fails.</p>
  
  <p>Is there a difference between URL-safe Base 64 decoding and the code that's widely available here on SO?  If anyone has experienced difficulties like this before, any insight on what to do is appreciated.</p>
  
  <p>Thanks, SO!</p>
  
  <p><strong>Edit 1:</strong> I used the Base 64 code found <a href="http://projectswithlove.com/projects/NSData_Base64.zip" rel="noreferrer">here</a>.  The original data (still Base64 encoded) can be found <a href="http://jakewood.org/Fingerprint.txt" rel="noreferrer">here</a>, the Objective-C generated can be found <a href="http://jakewood.org/Inflated.txt" rel="noreferrer">here</a>, and the Python generated can be found <a href="http://jakewood.org/Python.txt" rel="noreferrer">here</a>.  Ideally, I want the Objective C code to decode to the same text as the Python script.</p>