Skip to content

Commit ce3d9a3

Browse files
committed
Refactor jupyter--sign-message
1 parent 122748b commit ce3d9a3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

jupyter-messages.el

+6-5
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@ valid Jupyter message, see `jupyter--decode-message'."
5959
;; change byte length of a string" error.
6060
with key = (encode-coding-string
6161
(jupyter-session-key session) 'utf-8 t)
62-
with parts = (let ((parts (cdr parts))
63-
(str ""))
64-
(dotimes (_ 4 (encode-coding-string str 'utf-8 t))
65-
(setq str (concat str (car parts))
66-
parts (cdr parts))))
62+
with parts = (encode-coding-string
63+
(cl-loop
64+
with parts = parts
65+
repeat 4 concat (car parts)
66+
and do (setq parts (cdr parts)))
67+
'utf-8 t)
6768
for byte across (jupyter-hmac-sha256 parts key)
6869
concat (format "%02x" byte))
6970
""))

0 commit comments

Comments
 (0)