kasi.el

This package provides an easy way to manage secrets via M-x kasi.
Log | Files | Refs | LICENSE

commit cae99f70652312a19e0e19bf4bda63c091c268f9
parent 4ae6441547afd94eb8826cb2b4f13bc569dd9d56
Author: Vineet Kumar <git@vineetk.net>
Date:   Fri, 22 May 2026 18:33:47 -0400

reindent files

Diffstat:
Mkasi-totp.el | 4++--
Mkasi.el | 32++++++++++++++++----------------
2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/kasi-totp.el b/kasi-totp.el @@ -86,8 +86,8 @@ concept of encoding partial quanta is not implemented fully." (setq string (upcase string)) (let* ((trimmed-array (append (string-trim-right string "=+") nil)) (hex (format "%X" (seq-reduce - (lambda (acc char) (+ (ash acc 5) (aref base32-alphabet char))) - trimmed-array 0)))) + (lambda (acc char) (+ (ash acc 5) (aref base32-alphabet char))) + trimmed-array 0)))) (if (cl-oddp (length hex)) (concat "0" hex) hex))) diff --git a/kasi.el b/kasi.el @@ -91,23 +91,23 @@ Two %s are needed for password and username for now.") (kasi--filename-short file))))) (defun kasi--random-string (length charset) - "Generate a random string of LENGTH using characters from CHARSET. + "Generate a random string of LENGTH using characters from CHARSET. Uses /dev/urandom for cryptographic security." - ;; I have not seen any other built-in way to get cryptographically - ;; random outputs in Emacs. - (let* ((bytes (with-temp-buffer - (call-process "dd" nil (current-buffer) nil - "if=/dev/urandom" "bs=1" (format "count=%d" (* length 4))) - (buffer-string))) - (charset-len (length charset)) - (result "")) - (dotimes (i length) - (setq result (concat result - (char-to-string - (aref charset - (% (aref bytes i) - charset-len)))))) - result)) + ;; I have not seen any other built-in way to get cryptographically + ;; random outputs in Emacs. + (let* ((bytes (with-temp-buffer + (call-process "dd" nil (current-buffer) nil + "if=/dev/urandom" "bs=1" (format "count=%d" (* length 4))) + (buffer-string))) + (charset-len (length charset)) + (result "")) + (dotimes (i length) + (setq result (concat result + (char-to-string + (aref charset + (% (aref bytes i) + charset-len)))))) + result)) ;; TODO implement some kind of validation of the sexp when saving (defun kasi--edit (file)