1{-# LANGUAGE TypeFamilies #-}
11import Prelude hiding (null)
15import Data.UUID.Internal
17import Data.Int (Int64)
21 fromEnum ((time_hi_and_version unpacked `shiftR` 12) .&. 0xF)
23 unpacked = unpack uuid
25-- Note UUID time is in 10^-7 seconds.
26setTime :: (Integral a, Bits a) => UUID -> a -> Maybe UUID
29 then Just $ pack $ (unpack uuid){time_low = new_low_bits, time_mid = new_mid_bits, time_hi_and_version = new_hi_and_version_bits}
31 where new_low_bits = fromIntegral $ t .&. 0xFFFFFFFF
32 new_mid_bits = fromIntegral $ (t `shiftR` 32) .&. 0xFFFF
33 new_hi_and_version_bits = fromIntegral $ 0x1000 .|. ((t `shiftR` 48) .&. 0x0FFF)
35extractTime :: UUID -> Maybe Int64
38 then Just $ fromIntegral $ w32to64 (w16to32 (timeAndVersionToTime $ time_hi_and_version unpacked) $ time_mid unpacked) (time_low unpacked)
41 unpacked = unpack uuid
43timeAndVersionToTime :: Word16 -> Word16
44timeAndVersionToTime tv = tv .&. 0x0FFF
46extractMac :: UUID -> Maybe MAC
50 MAC (node_0 unpacked) (node_1 unpacked) (node_2 unpacked) (node_3 unpacked) (node_4 unpacked) (node_5 unpacked)
53 unpacked = unpack uuid
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list