Skip to content

Instantly share code, notes, and snippets.

;; fixed base64-decode-region that works with any number of characters (not just modulo 4)
(defun base64-decode ()
(interactive)
(when mark-active
(let* ((first (region-beginning))
(last (region-end))
(s (buffer-substring first last))
(slen (length s))
(srem (% slen 4))
(adjust (if (zerop srem)