about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMunyoki Kilyungi2026-02-16 13:33:12 +0300
committerMunyoki Kilyungi2026-02-16 13:33:12 +0300
commit89b70e6d35dd1044c4025616693d20fd4217df50 (patch)
tree9ecd5e598c09331eaf747e02dd87d16bcad8ae0c
parent37fd8cff683d7a9f36dadcb088736f3bbf9d0824 (diff)
downloadgn-transform-databases-89b70e6d35dd1044c4025616693d20fd4217df50.tar.gz
Add uuid function.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
-rw-r--r--transform/strings.scm13
1 files changed, 12 insertions, 1 deletions
diff --git a/transform/strings.scm b/transform/strings.scm
index 8b4ee45..c0f02e5 100644
--- a/transform/strings.scm
+++ b/transform/strings.scm
@@ -1,6 +1,11 @@
 (define-module (transform strings)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-19)
+  #:use-module (rnrs bytevectors)
+  #:use-module (uuid generate)
+  #:use-module (uuid utils)
+  #:use-module (uuid well-known)
+  #:use-module (ice-9 iconv)
   #:use-module (ice-9 match)
   #:use-module (ice-9 rdelim)
   #:use-module (ice-9 string-fun)
@@ -20,7 +25,13 @@
             fix-email-id
             blank-p
             investigator-attributes->id
-            path-without-extension))
+            path-without-extension
+            gn-uuid))
+
+(define (gn-uuid string)
+  (generate-string-uuid
+   'uuidv5
+   (string->bytevector string "UTF-8")))
 
 (define (blank-p str)
   (if (string-blank? str) #f str))