Java equivalent decoding for ObjectiveC
<p>I have a requirement to porting java code to objective. But I got stuck at the decoding mechanism used in Java. Due to the wrong decoding used in ObjectiveC, my final out is going wrong from Java code. Following is the java code, which I got stuck:</p>

<pre><code>String s = values.getProperty("s");
byte[] salt = Base64.getDecoder().decode(s);
System.out.println(s);
System.out.println("Salt DECODED = " + salt);
System.out.println("Decoded value as string " + new String(salt));
</code></pre>

<p>The output of above code follows</p>

<pre><code>'s' holds the string value "ZB3NNxAMNB/x6JpAryCd0g==",
'salt' holds the value "Salt DECODED = [B@180bc464",
'salt' hold the string value "Decoded value as string d�7"
</code></pre>

<p>When the same I written in objectiveC, I have used the following code</p>

<pre><code>NSString *s = parsedMessageDict[@"s"]; //ZB3NNxAMNB/x6JpAryCd0g==
NSData *salt = [[NSData alloc] initWithBase64EncodedString:s options:0];
</code></pre>

<p>The difference is that in Java salt is given as byte[] and in objectiveC, which is declared as NSData. Does this make any issue as going forward. Henceforth, all the data is processing based on the value. So I am doing wrong here itself, definitely, the final output will be wrong. </p>

<p>In objectiveC, should I decode the salt as string and convert to byte array or the NSData has to be converted to byte array?</p>

<p>Can anyone give suggestion? </p>