[Utils] Dual converter for ascii to hex

This commit is contained in:
Daniel - 2017-11-20 19:52:39 +01:00
parent db96088e07
commit 04ab68b09d
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 8 additions and 0 deletions

View File

@ -179,6 +179,14 @@ major mode MODE."
concat
message))
(defun db/ascii-to-hex (ascii-string)
"Convert ASCII-STRING to its hexadecimal representation."
(interactive "sString (ascii): ")
(->> (string-to-list ascii-string) ; redundant
(--map (format "%2X" it))
(apply #'concat)
message))
(defun db/ntp-to-time (high low &optional format-string)
"Format NTP time given by HIGH and LOW (both integer) to time as given by FORMAT-STRING.
If not given, FORMAT-STRING defaults to some ISO 8601-like format."