Hello Roland,
are there any substantial differences between the routines of the util.Strings and security.Base64 packages? What's the (dis)advantage of using one of the two packages?
There should be no differences regarding pure base64 encoding/decoding. However, as mentioned by Reuben, there is a constraint with security.Base64.FromByte()/ToByte() requiring the BYTE to be located in memory.
I see an advantage on using util.Strings because there are less dependencies to other libs, if you need only to do base64 conversions.
Here the deps of the security.so library on my Linux box:
$ ldd -r $FGLDIR/lib/security.so
linux-vdso.so.1 (0x00007ffcb99cd000)
libfglutils.so => /home/sf/genero/software/fglgws-5.00.03-NB/lib/libfglutils.so (0x00007fa30a200000)
libfglsecurity.so => /home/sf/genero/software/fglgws-5.00.03-NB/lib/libfglsecurity.so (0x00007fa309e00000)
libfglgws.so => /home/sf/genero/software/fglgws-5.00.03-NB/lib/libfglgws.so (0x00007fa309a00000)
libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3 (0x00007fa309400000)
libfgl.so => /home/sf/genero/software/fglgws-5.00.03-NB/lib/libfgl.so (0x00007fa309000000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa30a8f0000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fa308c00000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa30a811000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa30a5e0000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa30a01f000)
libiconv.so.2 => /home/sf/genero/software/fglgws-5.00.03-NB/lib/libiconv.so.2 (0x00007fa308800000)
libssl.so.3 => /lib/x86_64-linux-gnu/libssl.so.3 (0x00007fa30a537000)
libfgltransport.so => /home/sf/genero/software/fglgws-5.00.03-NB/lib/libfgltransport.so (0x00007fa308400000)
libfglxml.so => /home/sf/genero/software/fglgws-5.00.03-NB/lib/libfglxml.so (0x00007fa308000000)
libxml2.so.2 => /home/sf/genero/software/fglgws-5.00.03-NB/lib/libxml2.so.2 (0x00007fa307c00000)
libxslt.so.1 => /home/sf/genero/software/fglgws-5.00.03-NB/lib/libxslt.so.1 (0x00007fa307800000)
libwrtl.so => /home/sf/genero/software/fglgws-5.00.03-NB/lib/libwrtl.so (0x00007fa307400000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa30a808000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa30a912000)
libxmlsec1-openssl.so.1 => /home/sf/genero/software/fglgws-5.00.03-NB/lib/libxmlsec1-openssl.so.1 (0x00007fa307000000)
libxmlsec1.so.1 => /home/sf/genero/software/fglgws-5.00.03-NB/lib/libxmlsec1.so.1 (0x00007fa306c00000)
Versus libfgl.so, where the IMPORT util package is built-in:
$ ldd -r $FGLDIR/lib/libfgl.so
linux-vdso.so.1 (0x00007ffce853e000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2745ca0000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2745bc1000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2745bbc000)
libwrtl.so => /home/sf/genero/software/fglgws-5.00.03-NB/lib/libwrtl.so (0x00007f2745400000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f274521f000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2745cc0000)
I wasn't aware that both packages contain the same routines. Couldn't the documentation of the security.Base64 package point out to use the routines from util.Strings?
I will talk to the doc team about that, but usually we want to keep things independent.
You should be able to find all pages related to base64 support by using the doc search field.
Just try with "base64".
You make a good, point but this is not a doc problem but rather an implementation problem:
The signature these methods uses different parameter names
You can see this by using code completion in vim, GST or VSCode.
Best regards,
Seb