summaryrefslogtreecommitdiff
path: root/utilities.lisp
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-12-26 14:13:22 -0800
committerColin Okay <colin@cicadas.surf>2022-12-26 14:13:22 -0800
commit8e7fc055823fde522fb83f9a7d86dcba39dcf551 (patch)
tree85d2b529712c0e40df8a19ee1bbaf31e79387eb9 /utilities.lisp
initial commit; Add hero model definition
Diffstat (limited to 'utilities.lisp')
-rw-r--r--utilities.lisp25
1 files changed, 25 insertions, 0 deletions
diff --git a/utilities.lisp b/utilities.lisp
new file mode 100644
index 0000000..dd4455c
--- /dev/null
+++ b/utilities.lisp
@@ -0,0 +1,25 @@
+;;;; utilities -- nuff said
+
+(in-package :dungeons-and-deadlines)
+
+
+(let ((host (uiop:hostname))
+ (count 0))
+ (defun nuid ()
+ "Generates a Nearly Universal ID"
+ (format nil "~36r"
+ (sxhash
+ (list
+ (incf count)
+ host
+ (get-universal-time))))))
+
+(defun hash-string (plaintext salt)
+ "Hash plaintext using SALT"
+ (flexi-streams:octets-to-string
+ (ironclad:digest-sequence
+ :sha3
+ (flexi-streams:string-to-octets (concatenate 'string salt plaintext)
+ :external-format :utf-8))
+ :external-format :latin1))
+