From baaf778aa2a1d2f8b38d4671f59b88a7340d281d Mon Sep 17 00:00:00 2001 From: JSDurand Date: Mon, 1 Jun 2026 16:37:24 +0800 Subject: basic: uuid generation function * basic.el (durand-uuid): I just wrote this function so that I can easily generate message id's: I want to store my notes as mails, so I need to manually generate ids for links between notes to work. --- basic.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/basic.el b/basic.el index 7500fcb..54fb768 100644 --- a/basic.el +++ b/basic.el @@ -678,6 +678,15 @@ The remaining CONFIGS are evaluated after the package is loaded." (require ,package-name) ,@configs)) +;;; UUID generation + +(defun durand-uuid () + "Generate a kind of unique string." + (format + "<%s.%s@durand-emacs.local>" + (substring (secure-hash 'md5 (format-time-string "%x%X-%z")) 0 8) + (substring (secure-hash 'sha256 (format-time-string "%s%N")) 0 8))) + ;;; Test internet connection (defun durand-internet-on (&optional host) -- cgit v1.2.3-18-g5258