cannyboy
cannyboy

Reputation: 24426

Convert a hex string into base64?

I'm trying to convert a hex string into base64 on iPhone. The hex is:

5289be07c5c7edcc18f3a02c7b81c110b8637f8b2ddbc29cdabcbd7e394c1695

But I cant's seem to get the base64 version of this, which is:

Uom+B8XH7cwY86Ase4HBELhjf4st28Kc2ry9fjlMFpU=

How would I get this base64 string?

Upvotes: 0

Views: 1454

Answers (1)

borrrden
borrrden

Reputation: 33423

Since you are using SHA256 (I also use it), I assume you get an NSData output before you convert it to a hex string. Take that data, and use the category method shown in this question (the one with the most upvotes, that actually has the code inlined)

Upvotes: 1

Related Questions