Decode a base64 code into an array numbers (I1P).
use befor64 use penf integer(I1P) :: array_I1(1:2) call b64_decode(code='eP8=',n=array_I1) print "(L1)", str(n=array_I1)==str(n=[120_I1P,-1_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. |
pure subroutine b64_decode_I1_a(code, n)
!< Decode a base64 code into an array numbers (I1P).
!<
!<```fortran
!< use befor64
!< use penf
!< integer(I1P) :: array_I1(1:2)
!< call b64_decode(code='eP8=',n=array_I1)
!< print "(L1)", str(n=array_I1)==str(n=[120_I1P,-1_I1P])
!<```
!=> T <<<
character(*), intent(in) :: code !< Encoded array.
integer(I1P), intent(out) :: n(1:) !< Array of numbers to be decoded.
integer(I1P), allocatable :: nI1P(:) !< One byte integer array containing n.
allocate(nI1P(1:size(n,dim=1)*BYI1P)) ; nI1P = 0_I1P
call decode_bits(code=code,bits=nI1P)
n = transfer(nI1P,n)
endsubroutine b64_decode_I1_a