summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-04-24 00:08:22 +0300
committerThanos Apollo <[email protected]>2024-04-24 00:08:22 +0300
commitab94733012781cd9863a1b45d4fc86eed9a918cd (patch)
tree2f05e8ce25cd9389cfeec37d0154755a439d8fe0
parent7dde8ff1601df2995d9601c69bdc473960e5457a (diff)
gnosis-generate-id: Use random length
-rw-r--r--gnosis.el4
1 files 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)))