powturbo / Turbo-Base64

Turbo Base64 - Fastest Base64 SIMD:SSE/AVX2/AVX512/Neon/Altivec - Faster than memcpy!
GNU General Public License v3.0
277 stars 41 forks source link

Sample example for Turbo-Base64 #22

Open NamespaceAyush opened 1 year ago

NamespaceAyush commented 1 year ago

Hey, Seems like a great library can you please provide a simple example of how to use this library? I having issues figuring a few things out like do I have to allocate the memory for the output buffer too after decoding, I think a sample simple example will help a lot of people.

Thank you

sergeevabc commented 10 months ago

Indeed, we need something more practical here, a CLI tool to try encoding and decoding with a switch to wrap lines. For example, what I use under Windows 7 x64.

$ busybox.exe base64 --help

BusyBox v1.37.0-FRP-5181-g5c1a3b00e (2023-08-18 12:16:29 BST)

Usage: base64 [-d] [-w COL] [FILE]

Base64 encode or decode FILE to standard output

        -d      Decode data
        -w COL  Wrap lines at COL (default 76, 0 disables)

$ busybox.exe base64 patch.zip > patch.zip.b64