Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bin2Data
#1
Say hello to Bin2Data.

[Image: screenshot.png]

Bin2Data is a command-line tool that allows for the conversion of binary files to Base64 encoded DATA / CONST statements. The companion library allows for the decoding of Base64 encoded data back into its binary form. The data is optionally compressed using Google's Zopfli compression library if it sees any goodness. This means that files that are already compressed, may not go through one more compression and decompression step. The compressed data is compatible with QB64-PE's _DEFLATE$.

The original idea for this tool and library comes from two awesome tools: DAV's BASFILE and RhoSigma's MakeDATA.

So, what different about Bin2Data? Two things:
  1. It uses Google's Zopfli deflate based compressor. Zopfli is one of the best deflate compressor in the world.
  2. It can generate the data to CONSTs. Which means there is no performance hit that happens when loading files from DATA statements and string concatenation. String concatenation happens at compile time.

Get the latest source for the tool from: https://github.com/a740g/Bin2Data
Get the pre-compiled Windows binaries from https://github.com/a740g/Bin2Data/releases/latest


If you do not want to go through the effort of downloading and using the companion library from GitHub, then use the standalone version in the zip file below. It's based on the same QB64 base64 decoder that I shared here. Is has two demos - one for DATA and another for CONST.

Cheers and happy holidays!


Attached Files
.zip   libbase64.zip (Size: 119.01 KB / Downloads: 47)
.zip   Bin2Data.zip (Size: 459.89 KB / Downloads: 9)
Reply




Users browsing this thread: 2 Guest(s)