0

I am using this function in Java to generated a secrect URL Parameter:

new String(Base64Encoding.encode(String.valueOf(vendorId), Bean.getSessionId()))

And i need to do the same in my ios app, can someone help? Only found examples for base64 encoding. But not how to say this is my "salt". (Sessionid).

Ludwig Meier
  • 277
  • 1
  • 4
  • 12

1 Answers1

2

There is no ready to use function for Base64 in iOS. However you can use one of existing implementations and libraries. You can check on of those:

https://github.com/nicklockwood/Base64/

https://gist.github.com/0xced/1901480

Salt is just concatenated to the String. So if your Salt is "MySalt" than it's combining Salt with your string and do Base64 on concatenated String. You need to make salt value equal on both devices - just define it as your secret on both platforms.

Grzegorz Krukowski
  • 18,081
  • 5
  • 50
  • 71