25 lines
915 B
Plaintext
25 lines
915 B
Plaintext
(setq *Char64
|
|
`'(chop
|
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" ) )
|
|
(de decode64 (S)
|
|
(let S (chop S)
|
|
(pack
|
|
(make
|
|
(while S
|
|
(let
|
|
(A (dec (index (++ S) *Char64))
|
|
B (dec (index (++ S) *Char64))
|
|
C (dec (index (++ S) *Char64))
|
|
D (dec (index (++ S) *Char64)) )
|
|
(link
|
|
(char (| (>> -2 A) (>> 4 B))) )
|
|
(and
|
|
C
|
|
(link
|
|
(char
|
|
(| (>> -4 (& B 15)) (>> 2 C)) ) )
|
|
D
|
|
(link
|
|
(char (| (>> -6 (& C 3)) D)) ) ) ) ) ) ) ) )
|
|
(prinl (decode64 "VG8gZXJyIGlzIGh1bWFuLCBidXQgdG8gcmVhbGx5IGZvdWwgdGhpbmdzIHVwIHlvdSBuZWVkIGEgY29tcHV0ZXIuCiAgICAtLVBhdWwgUi5FaHJsaWNo"))
|