summaryrefslogtreecommitdiff
path: root/src/base32.lisp
diff options
context:
space:
mode:
authorPiotr Szarmanski2022-09-25 00:55:55 +0200
committerPiotr Szarmanski2022-09-25 00:55:55 +0200
commit67d00dc4ce131d5cc46f4041dbf40391697e281d (patch)
treece5a72abb52d3ed1d63d1b816a5caa371ca0d3c2 /src/base32.lisp
parent9ed9bd758871d2f01a3d19192e9808ce19925a16 (diff)
Clean up docstrings and type declarations.
Diffstat (limited to 'src/base32.lisp')
-rw-r--r--src/base32.lisp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/base32.lisp b/src/base32.lisp
index 0ed4624..ec0340b 100644
--- a/src/base32.lisp
+++ b/src/base32.lisp
@@ -183,9 +183,13 @@
base32-bytes))
(defun base32-to-bytes-unpadded (base32-string)
+ "Return the bytes decoded from the supplied base32 string that was produced with
+padding removed."
(let ((padding (make-array (- 8 (mod (length base32-string) 8)) :element-type 'character :initial-element #\=)))
(base32-to-bytes (concatenate 'string base32-string padding))))
(defun bytes-to-base32-unpadded (bytes)
+ "Return a base32 string encoding of the provided vector of bytes, without any
+padding."
(let ((string (bytes-to-base32 bytes)))
(subseq string 0 (position #\= string))))