Skip to content
Stefano Zaghi edited this page Feb 2, 2015 · 1 revision

This example demonstrates the encoding/decoding of numbers into/from a base64 ascii string.

Scalar encoding
character(len=:), allocatable:: code64 ! base64 encoded string
...
call b64_encode(n=12._R8P,code=code64)
Array encoding
character(len=:), allocatable:: code64 ! base64 encoded string
...
call b64_encode(n=[12_I4P,1_I4P],code=code64)
Scalar decoding
real(R8P):: decoded ! scalar to be decoded
...
call b64_decode(code='AAAAAAAA8D8=',n=decoded)
Array decoding
integer(I8P):: decoded(1:4) ! array to be decoded
...
call b64_decode(code='FwAAAAAAAABEAQAAAAAAABBwhAEAAAAAAgAAAAAAAAA=',n=decoded)

These examples and many others are contained into the autotest procedure. Run the Test_Driver program for checking them.