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 a scalar string.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=I1P), | public, | allocatable | :: | nI1P(:) | One byte integer array containing n. |
elemental subroutine b64_decode_string(code, s)
!---------------------------------------------------------------------------------------------------------------------------------
!< Decode a base64 code into a scalar string.
!---------------------------------------------------------------------------------------------------------------------------------
character(*), intent(in) :: code !< Encoded scalar.
character(*), intent(out) :: s !< String to be decoded.
integer(I1P), allocatable :: nI1P(:) !< One byte integer array containing n.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
allocate(nI1P(1:byte_size(s))) ; nI1P = 0_I1P
call decode_bits(code=code,bits=nI1P)
s = transfer(nI1P,s)
return
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine b64_decode_string