Decode a base64 code into an array of strings.
use befor64 use penf character(5) :: array_s(1:2) call b64_decode(code='aGVsbG93b3JsZA==',s=array_s) print "(L1)", array_s(1)//array_s(2)=='helloworld'
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | code | Encoded scalar. |
||
character(len=*), | intent(out) | :: | s(1:) | String to be decoded. |
pure subroutine b64_decode_string_a(code, s)
!< Decode a base64 code into an array of strings.
!<
!<```fortran
!< use befor64
!< use penf
!< character(5) :: array_s(1:2)
!< call b64_decode(code='aGVsbG93b3JsZA==',s=array_s)
!< print "(L1)", array_s(1)//array_s(2)=='helloworld'
!<```
!=> T <<<
character(*), intent(in) :: code !< Encoded scalar.
character(*), intent(out) :: s(1:) !< String to be decoded.
integer(I1P), allocatable :: nI1P(:) !< One byte integer array containing n.
allocate(nI1P(1:byte_size(s(1))*size(s,dim=1))) ; nI1P = 0_I1P
call decode_bits(code=code,bits=nI1P)
s = transfer(nI1P,s)
endsubroutine b64_decode_string_a