Decode a base64 code into an array numbers (I4P).
use befor64 use penf integer(I4P) :: array_I4(1:2) call b64_decode(code='5wcAAOj///8=',n=array_I4) print "(L1)", str(n=array_I4)==str(n=[2023_I4P,-24_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. |
pure subroutine b64_decode_I4_a(code, n)
!< Decode a base64 code into an array numbers (I4P).
!<
!<```fortran
!< use befor64
!< use penf
!< integer(I4P) :: array_I4(1:2)
!< call b64_decode(code='5wcAAOj///8=',n=array_I4)
!< print "(L1)", str(n=array_I4)==str(n=[2023_I4P,-24_I4P])
!<```
!=> T <<<
character(*), intent(in) :: code !< Encoded array.
integer(I4P), 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)*BYI4P)) ; nI1P = 0_I1P
call decode_bits(code=code,bits=nI1P)
n = transfer(nI1P,n)
endsubroutine b64_decode_I4_a