diff options
author | Thanos Apollo <[email protected]> | 2024-04-24 00:08:22 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-04-24 00:08:22 +0300 |
commit | ab94733012781cd9863a1b45d4fc86eed9a918cd (patch) | |
tree | 2f05e8ce25cd9389cfeec37d0154755a439d8fe0 /gnosis.el | |
parent | 7dde8ff1601df2995d9601c69bdc473960e5457a (diff) |
gnosis-generate-id: Use random length
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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))) |