Working on Base-85 Encoder/Decoder Functions - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Works in Progress (https://qb64phoenix.com/forum/forumdisplay.php?fid=9) +---- Thread: Working on Base-85 Encoder/Decoder Functions (/showthread.php?tid=2027) Pages:
1
2
|
RE: Working on Base-85 Encoder/Decoder Functions - SMcNeill - 09-23-2023 Try this version @Dav : Code: (Select All)
I tried to change and simplify the process as much as possible here. From the initial testing, all seems to be working now as it should, without that stray "0" popping up from time to time and biting you in the hiney. Try it out and let me know if it works as advertised, or not, for you. RE: Working on Base-85 Encoder/Decoder Functions - Dav - 09-23-2023 Works perfectly so far! I gave it one of my testing methods and let it run on loop for a couple minutes. No problems at all! Thanks for the fix Steve. I'll post my test program for those interested. It just generates random data strings and check the original size and content with the decoded size and content. If there's a change then say so and stop. Hasn't stopped yet. On a side note, I have updated my Base85 functions on the first post to use CVL/MKL$ to do some dirty work, removing some calculations and code bloat. A little faster, a little smaller. - Dav Edit: Fixed a typo in code. Try'er again. Code: (Select All)
RE: Working on Base-85 Encoder/Decoder Functions - Dav - 09-23-2023 Did some bench marking using the Base64, Base85, Base128 encoders using a 50,371 byte file for testing. Seeing which would be the best to use for resource packing in BAS code. All 3 have their advantages. Here are the results... The Base128 is best on making smallest output size, slower decoding. The Base64 encodes fast, but makes largest output size. The Base85 decodes fast, output size in between others. - Dav RE: Working on Base-85 Encoder/Decoder Functions - SMcNeill - 09-24-2023 Fastest would probably just be hex. Use _HEX$ and "&H" to convert back and forth. Since decoding is something I tend to do only once to unpack resources at startup, speed isn't usually my primary concern. The fewer lines I have to scroll past and the less lag in the IDE from excessively long programs, the happier I am! RE: Working on Base-85 Encoder/Decoder Functions - Dav - 09-25-2023 Hexified data that would be called Base 16? I use to use that in Qbasic programs a lot, saving and restoring palette data. I sure hope I didn't come across complaining about those routines you posted in any way. They aren't too slow. They are great! I think i will finish the Base91, then put the Base64/85/91 encoders in one collection. After that take a break on encoded things - it's making me to start seeing everything si-goggly... - Dav RE: Working on Base-85 Encoder/Decoder Functions - Dav - 09-26-2023 I've been studying how you did your encoder, @SMcNeill. Really smart combining the binary data strings and the grouping those into smaller chunks. I'm going to play around doing that. - Dav RE: Working on Base-85 Encoder/Decoder Functions - Dav - 09-28-2023 With some advice from @RhoSigma I was able to get these function to encode and decode so much faster. A 1MB string takes only .25 seconds on my slow laptop to encode. The first post has been edited with the updated functions. Thanks Rho! - Dav |