Decode numbers (integer and real) from base64.
This is an interface for decoding integer and real numbers of any kinds from a base64 string. This interface can decode both scalar and array.
Before start to decode anything the library must be initialized. The procedure b64_init must be called at first. The
global variable is_b64_initialized can be used to check the status of the initialization.
For a practical example see the autotest procedure.
real(R8P):: decoded ! scalar to be decoded ... call b64_decode(code='AAAAAAAA8D8=',n=decoded)
integer(I8P):: decoded(1:4) ! array to be decoded ... call b64_decode(code='FwAAAAAAAABEAQAAAAAAABBwhAEAAAAAAgAAAAAAAAA=',n=decoded)
If you want to decode heterogenous data (e.g. integer and real numbers), you must use the auxiliary pack_data
procedure.
The decoding of array of strings is admitted only if each string of the array has the same length.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
Decode a base64 code into a scalar number (R8P).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | code | Encoded scalar. |
||
| real(kind=R8P), | intent(out) | :: | n | Number to be decoded. |
Decode a base64 code into an array numbers (R8P).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | code | Encoded array. |
||
| real(kind=R8P), | intent(out) | :: | n(1:) | Array of numbers to be decoded. |
Decode a base64 code into a scalar number (R4P).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | code | Encoded scalar. |
||
| real(kind=R4P), | intent(out) | :: | n | Number to be decoded. |
Decode a base64 code into an array numbers (R4P).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | code | Encoded array. |
||
| real(kind=R4P), | intent(out) | :: | n(1:) | Array of numbers to be decoded. |
Decode a base64 code into a scalar number (I8P).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | code | Encoded scalar. |
||
| integer(kind=I8P), | intent(out) | :: | n | Number to be decoded. |
Decode a base64 code into an array numbers (I8P).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | code | Encoded array. |
||
| integer(kind=I8P), | intent(out) | :: | n(1:) | Array of numbers to be decoded. |
Decode a base64 code into a scalar number (I4P).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | code | Encoded scalar. |
||
| integer(kind=I4P), | intent(out) | :: | n | Number to be decoded. |
Decode a base64 code into an array numbers (I4P).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | code | Encoded array. |
||
| integer(kind=I4P), | intent(out) | :: | n(1:) | Array of numbers to be decoded. |
Decode a base64 code into a scalar number (I2P).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | code | Encoded scalar. |
||
| integer(kind=I2P), | intent(out) | :: | n | Number to be decoded. |
Decode a base64 code into an array numbers (I2P).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | code | Encoded array. |
||
| integer(kind=I2P), | intent(out) | :: | n(1:) | Array of numbers to be decoded. |
Decode a base64 code into a scalar number (I1P).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | code | Encoded scalar. |
||
| integer(kind=I1P), | intent(out) | :: | n | Number to be decoded. |
Decode a base64 code into an array numbers (I1P).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | code | Encoded array. |
||
| integer(kind=I1P), | intent(out) | :: | n(1:) | Array of numbers to be decoded. |
Decode a base64 code into a scalar string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | code | Encoded scalar. |
||
| character(len=*), | intent(out) | :: | s | String to be decoded. |
Decode a base64 code into an array of strings.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | code | Encoded scalar. |
||
| character(len=*), | intent(out) | :: | s(1:) | String to be decoded. |