on master help sign in
small fixes to V5 generation

I'm still messing up the time_high field, I think.

commitdf4f69fe564d638f78cdbe23aa003a16c405409d authoraslatter <aslatter@gmail.com> dateThu 2 Oct 2008, 06:16 (18 years ago) parentcb4b691
1 file changed+3−3
Data/UUID/V5.hs+3−3
Data/UUID/V5.hs+3−3
@@ -51,8 +51,8 @@ generateNamed namespace object =
5151 SHA1.Word160 w1 w2 w3 w4 w5 = SHA1.hash chunk
5252
5353 tl = w1
54− tm = low16 w2
55− th = (versionSHA .|.) $ (versionMask .&.) $ high16 w2
54+ tm = high16 w2
55+ th = (versionSHA .|.) $ (versionMask .&.) $ low16 w2
5656 ch = (reserved .|.) $ (reservedMask .&.) $ high8 $ high16 w3
5757 cl = low8 $ high16 w3
5858 node = Node (high8 (low16 w3))
@@ -79,7 +79,7 @@ low8 :: Word16 -> Word8
7979low8 = fromIntegral . (.&. 0x00FF)
8080
8181high8 :: Word16 -> Word8
82−high8 = fromIntegral . flip shiftR 4
82+high8 = fromIntegral . flip shiftR 8
8383
8484versionSHA = shiftL 12 5
8585