Share this post

Link to post

Share on other sites

Valik 467

I would recommend CyberSlug's second post. The code I wrote was for a general base converter (Between 2 and 36), so it doesn't have any optimizations for some conversions. Since all I did was port that from C to AutoIt and hard-code it to be binary only, its probably not as fast as what he just posted.

Share this post

Link to post

Share on other sites

Valik 467

Everyone seems to have missed the easiest way...just using BitShift and BitAnd to pop off a bit at a time...

The easiest way isn't always the most obvious, apparently. I didn't think of bit shifting at all, even after seeing CyberSlug use some Bit operators in his example. I need to remember this isn't C++ and these variables are typeless and I can do that sort of thing, too.

Share this post

Link to post

Share on other sites

Bartokv 1

I made yet another function that will convert nearly any number to any base between base 2 and base 62. It doesn't utilize bit shifting, isn't optimized in any way, and is a little absurd to be honest. ...But I thought that some people may find it a little interesting:

Please note: Any character values [A-Z] in base 36 and below are parsed as Uppercase. Numbers in base 37 to base 62 will parse Upper and lower case characters differently. (Upper characters are first) If you have any questions on this, please let me know.