Navigation Menu

Skip to content

Commit

Permalink
Strip trailing whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterScott committed Sep 16, 2013
1 parent 80c4e85 commit cc4614d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pwstore-fast/Crypto/PasswordStore.hs
Expand Up @@ -184,7 +184,7 @@ pbkdf2 password (SaltBS salt) c =
int :: Int -> ByteString
int i = let str = BL.unpack . Binary.encode $ i
in BS.pack $ drop (length str - 4) str

-- | A convenience function to XOR two 'ByteString' together.
xor' :: ByteString -> ByteString -> ByteString
xor' !b1 !b2 = BS.pack $ BS.zipWith xor b1 b2
Expand Down Expand Up @@ -252,7 +252,7 @@ makePassword = makePasswordWith pbkdf1
-- to choose the algorithm to use.
--
-- >>> makePasswordWith pbkdf1 "password" 12
--
--
makePasswordWith :: (ByteString -> Salt -> Int -> ByteString)
-- ^ The algorithm to use (e.g. pbkdf1)
-> ByteString
Expand Down Expand Up @@ -369,7 +369,7 @@ newtype Salt = SaltBS ByteString
-- this function.
makeSalt :: ByteString -> Salt
makeSalt = SaltBS . encode . check_length
where check_length salt | B.length salt < 8 =
where check_length salt | B.length salt < 8 =
error "Salt too short. Minimum length is 8 characters."
| otherwise = salt

Expand Down

0 comments on commit cc4614d

Please sign in to comment.