suve

awful: function: base64-decode

Available since rev.36 (v.0.5.0).

Declaration

ascii :base64-decode ( string $MESSAGE )
ascii :decodeBase64 ( string $MESSAGE )

Summary

Takes a string encoded in MIME Base64 and returns the original data. Note that the data may turn out to be binary, not text.

Example

# :base64-decode example.
:set &enc :base64-decode s'VGhpcyBpcyBzb21lIGRlY29kZWQgdGV4dC4='
:set &str s'This is some decoded text.'

!if :eq $enc $str
    :writeln s"awful's Base64-decode seems to work fine."
!else
    :writeln s"Uh-oh, it seems awful's Base64-decode is broken!"
!fi

wikipage modified on 2014/0601/2316