From 8e7fc055823fde522fb83f9a7d86dcba39dcf551 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Mon, 26 Dec 2022 14:13:22 -0800 Subject: initial commit; Add hero model definition --- utilities.lisp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 utilities.lisp (limited to 'utilities.lisp') 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)) + -- cgit v1.2.3