Convert Base64 GZipped string Objective-c or Swift

前端 未结 1 919
时光说笑
时光说笑 2021-01-22 13:17

I received a string from a web service like this:

CAAAAB+LCAAAAAAABADtvQdgHEmWJSYvbcp7f0r1StfgdKEIgGATJNiQQBDswYjN5pLsHWlHIymrKoHKZVZlXWYWQMztnbz33nvvvffee++997o         


        
相关标签:
1条回答
  • 2021-01-22 13:24

    This answer here covers Base64.

    zlib is available directly as a shared library on Mac OS X and iOS. It can decompress gzip streams.

    Note that the first four bytes of your example have to be stripped before you get to the gzip stream. They appear to contain the size of the uncompressed data in little-endian form. (They are 08 00 00 00 in your example.)

    0 讨论(0)
提交回复
热议问题