From 65ed7a61f1ad01da440f0e7e08bfc32b43deed73 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 18 Jun 2023 02:00:00 +0200 Subject: uuid: Fix NTFS UUID stringification. Previously, (ntfs-uuid->string (string->ntfs-uuid"5234ED0D34ECF53F")) would yield "5234EDD34ECF53F". Reported by sughosha in #guix. * gnu/system/uuid.scm (ntfs-uuid->string): Pad hex bytes with zero when needed. --- gnu/system/uuid.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu') diff --git a/gnu/system/uuid.scm b/gnu/system/uuid.scm index a95dc1b7d1..8f967387ad 100644 --- a/gnu/system/uuid.scm +++ b/gnu/system/uuid.scm @@ -209,7 +209,7 @@ ISO9660 UUID representation." (define (ntfs-uuid->string uuid) "Convert NTFS UUID, a 8-byte bytevector, to its string representation." - (format #f "~{~:@(~x~)~}" (reverse (bytevector->u8-list uuid)))) + (format #f "~{~:@(~2,'0x~)~}" (reverse (bytevector->u8-list uuid)))) (define %ntfs-uuid-rx (make-regexp "^([[:xdigit:]]{16})$")) -- cgit v1.2.3