EncodeHex function in IOS/Xojo Framework?

Hey all,

I’m converting some methods from the normal framework to the iOS/XojoFramework. In one case I use some EncodeHex and DecodeHex calls on some string data. iOS can’t use strings even internally so I have to use Text, but there’s no EncodeHex or DecodeHex methods for the Text class.

What do you use instead?

Thanks,

Jon

write them ?
put the text into a memoryblock then properly encode as hex each Uint8

then do decode reverse that and define the encoding of the resulting text

its not much code

My M_Text module has this.

http://www.mactechnologies.com/index.php?page=downloads#m_text

The Xojo.Core.MemoryBlock page has sample code for Encode/DecodeHex.

https://documentation.xojo.com/api/deprecated/xojo.core.memoryblock.html

[quote=477204:@Paul Lefebvre]The Xojo.Core.MemoryBlock page has sample code for Encode/DecodeHex.

https://documentation.xojo.com/api/deprecated/xojo.core.memoryblock.html[/quote]
Yeah. I saw that and implemented it.

That’s the thing so wonderful about the Xojo framework. All the nice functions that used to exist are left to the user to do. The memory block read/write with TCP sockets is the most ridiculous one of all.

The good news is, once iOS shifts to API 2, you won’t have to worry about it.

Agreed. Except it will be too late for a lot of the work I am doing now! Wish I knew when the plan to release it is.

FYI… I don’t know what the “declares” would be, but iOS has full BASE64 support built in… I used it in an email function I wrote for a Swift program a year or so back.

No need for declares. The example in the docs was all I needed.

my point was, that like a lot of things in “Xojo for iOS”… these are workarounds to what is otherwise built into the iOS operating system… And in my opinion, such workarounds ultimately come around to bite you in the a$$ at some future date.

If you use MBS Xojo Encryption kit, there is a EncodeHex method included.

An encode/decode hex function is hardly a workaround. That said, it’s pretty cheesy it didn’t make it into the iOS framework. Just like there’s no RegEx either. Hopefully we API 2.0 for IOS we can have things like RegEx and String types, etc.

to me a workaround is any code that attempts to duplicate a feature or function that exists natively within the hosting operating system… and iOS has native BASE64 encode/decode functions. So yes, these memoryblock manipulations are a “workaround”

Dave everyone knows you hate Xojo for iOS. You don’t need to mention it every single iOS thread…

But BASE64 isnt encode as hex