commit 2816c8c7bae0ed0bacd00b77a9c5dd5d3ed19a42 parent 646ad30cc7e11b18bb9ce3513da561797e73f244 Author: Tomas Hlavaty <tom@logand.com> Date: Sun, 31 Aug 2014 21:53:35 +0200 base64 custom suffix Diffstat:
M | base64.lisp | | | 6 | +++--- |
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/base64.lisp b/base64.lisp @@ -27,7 +27,7 @@ (in-package :rw.base64) -(defun encode-reader (reader &key table wrap) ;; TODO wrap 76 +(defun encode-reader (reader &key table (suffix #\=)) (let (pending (table (or table "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"))) @@ -47,8 +47,8 @@ (b (%next)) (c (%next)) (x (+ (ash a 16) (ash (or b 0) 8) (or c 0)))) - (push (if c (%map x 0) #\=) pending) - (push (if b (%map x 6) #\=) pending) + (push (if c (%map x 0) suffix) pending) + (push (if b (%map x 6) suffix) pending) (push (%map x 12) pending) (%map x 18))))))))