Decode a base64 code into a scalar number (I4P).
use befor64 use penf integer(I4P) :: scalar_I4 call b64_decode(code='5wcAAA==',n=scalar_I4) print "(L1)", scalar_I4==2023_I4P
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | code | Encoded scalar. |
||
integer(kind=I4P), | intent(out) | :: | n | Number to be decoded. |
elemental subroutine b64_decode_I4(code, n)
!< Decode a base64 code into a scalar number (I4P).
!<
!<```fortran
!< use befor64
!< use penf
!< integer(I4P) :: scalar_I4
!< call b64_decode(code='5wcAAA==',n=scalar_I4)
!< print "(L1)", scalar_I4==2023_I4P
!<```
!=> T <<<
character(*), intent(in) :: code !< Encoded scalar.
integer(I4P), intent(out) :: n !< Number to be decoded.
integer(I1P), allocatable :: nI1P(:) !< One byte integer array containing n.
allocate(nI1P(1:BYI4P)) ; nI1P = 0_I1P
call decode_bits(code=code,bits=nI1P)
n = transfer(nI1P,n)
endsubroutine b64_decode_I4