better letter choice for hashing
This commit is contained in:
parent
500c4e44c5
commit
137257ded1
1 changed files with 2 additions and 2 deletions
|
@ -162,8 +162,8 @@ display_32bits_as_dir :: Word32 -> String
|
||||||
display_32bits_as_dir w = trim $ swap_pairs cs
|
display_32bits_as_dir w = trim $ swap_pairs cs
|
||||||
where
|
where
|
||||||
-- Need 32 characters to use. To avoid inaverdently making
|
-- Need 32 characters to use. To avoid inaverdently making
|
||||||
-- a real word, use the alphabet without vowels.
|
-- a real word, use letters that appear less frequently.
|
||||||
chars = ['0'..'9'] ++ "bcdfghjklnmpqrstvwxyzZ"
|
chars = ['0'..'9'] ++ "zqjxkmvwgpfZQJXKMVWGPF"
|
||||||
cs = map (\x -> getc $ (shiftR w (6*x)) .&. 31) [0..7]
|
cs = map (\x -> getc $ (shiftR w (6*x)) .&. 31) [0..7]
|
||||||
getc n = chars !! (fromIntegral n)
|
getc n = chars !! (fromIntegral n)
|
||||||
swap_pairs (x1:x2:xs) = x2:x1:swap_pairs xs
|
swap_pairs (x1:x2:xs) = x2:x1:swap_pairs xs
|
||||||
|
|
Loading…
Reference in a new issue