Base64 encode data: Difference between revisions

(My solution in Common Lisp)
Line 485:
=={{header|Common Lisp}}==
 
A nice example for the CL eco system using [http://quickdocs.org/cl-base64/ cl-base64] and [https://www.cliki.net/Drakma drakma].
<lang lisp>
<lang lisp>(eval-when (:load-toplevel :compile-toplevel :execute)
(ql:quickload "drakma")
(ql:quickload "cl-base64"))
Line 501 ⟶ 502:
(output (loop
with array = (make-array 0 :element-type 'unsigned-byte
:adjustable t :fill-pointer 0)
for data-chunk = (read-byte input nil nil)
while data-chunk
Line 507 ⟶ 508:
finally (return (usb8-array-to-base64-string array)))))
(close input)
output))</lang>
</lang>
{{out}}
<pre>"AAABAAIAEBAAAAAAAABoBQAAJgAAACAgAAAAAAAAqAgAAI4FAAAoAAAAEAAAACAAAAABAAgAAAAAAEABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///...</pre>