From ab94733012781cd9863a1b45d4fc86eed9a918cd Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Wed, 24 Apr 2024 00:08:22 +0300 Subject: gnosis-generate-id: Use random length --- gnosis.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnosis.el b/gnosis.el index 777cfd6..f614e84 100644 --- a/gnosis.el +++ b/gnosis.el @@ -520,8 +520,8 @@ When called with a prefix, unsuspends all notes for tag." (defun gnosis-generate-id (&optional length) "Generate a unique note ID. -LENGTH: lenghth of id, default to 12." - (let* ((length (or length 12)) +LENGTH: length of id, default to a random number between 10-15." + (let* ((length (or length (+ (random 5) 10))) (max-val (expt 10 length)) (min-val (expt 10 (1- length))) (id (+ (random (- max-val min-val)) min-val))) -- cgit v1.2.3