ios - Decoding base64 string which is encoded in android -


i have string need decode ios encrypted in android using base64.

string encoded = (base64.encodetostring(vals, base64.default)); 

same string trying decode in objective c getting nil // stringtodeccode string encoded in android

nsdata *decodeddata = [[nsdata alloc] initwithbase64encodedstring:stringtodeccode options:0]; nsstring *decodedstring = [[nsstring alloc] initwithdata:decodeddata encoding:nsutf8stringencoding]; 

// decodedstring nil

the same string have used website able decode. https://www.base64decode.org/

let me know doing wrong

i think have problem in input text

here android code

    string encoded = (base64.encodetostring("ios developer".getbytes(), base64.default)); 

// text encoded android su9tierldmvsb3blcg==

ios code

 nsdata *decodeddata = [[nsdata alloc] initwithbase64encodedstring:@"su9tierldmvsb3blcg==" options:0];     nsstring *decodedstring = [[nsstring alloc] initwithdata:decodeddata encoding:nsutf8stringencoding];      nslog(@"%@",decodedstring); 

Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -