Decode a base64 code into an array numbers (R4P).
use befor64 use penf real(R4P) :: array_R4(1:2) call b64_decode(code='AAAAAOF6AMI=',n=array_R4) print "(L1)", str(n=array_R4)==str(n=[0._R4P,-32.12_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. |
pure subroutine b64_decode_R4_a(code, n)
!< Decode a base64 code into an array numbers (R4P).
!<
!<```fortran
!< use befor64
!< use penf
!< real(R4P) :: array_R4(1:2)
!< call b64_decode(code='AAAAAOF6AMI=',n=array_R4)
!< print "(L1)", str(n=array_R4)==str(n=[0._R4P,-32.12_R4P])
!<```
!=> T <<<
character(*), intent(in) :: code !< Encoded array.
real(R4P), 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)*BYR4P)) ; nI1P = 0_I1P
call decode_bits(code=code,bits=nI1P)
n = transfer(nI1P,n)
endsubroutine b64_decode_R4_a