guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UUID3 implementation for Guile


From: pelzflorian (Florian Pelz)
Subject: Re: UUID3 implementation for Guile
Date: Mon, 8 Jan 2018 16:47:45 +0100
User-agent: NeoMutt/20171208

On Mon, Jan 08, 2018 at 03:58:01PM +0100, pelzflorian (Florian Pelz) wrote:
> P.S. If and only if you want to check it out, this is my current
> implementation.  It should probably be made to accept messages from
> ports instead of taking a complete bytevector as input.
> 

I forgot to mention;

(use-modules (uuid)
             (rnrs bytevectors))

(display
 (make-version-3-uuid
  (u8-list->bytevector
   ;; URL namespace UUID is 6ba7b811-9dad-11d1-80b4-00c04fd430c8
   '(#x6b #xa7 #xb8 #x11 #x9d #xad #x11 #xd1 #x80 #xb4
          #x00 #xc0 #x4f #xd4 #x30 #xc8))
  "https://example.org";))
(newline)

yields the same result as Python’s

import uuid
uuid.uuid3(uuid.NAMESPACE_URL, 'https://example.org')


Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]