implemented toUTF8

This commit is contained in:
Jonathan Lamothe 2018-12-21 17:17:12 -05:00
parent 9a2333140a
commit d53fde8c54
2 changed files with 4 additions and 1 deletions

View File

@ -30,6 +30,7 @@ library:
source-dirs: src source-dirs: src
dependencies: dependencies:
- SHA - SHA
- text
executables: executables:
passman: passman:

View File

@ -50,6 +50,8 @@ import Data.Char (isUpper, isLower, isDigit, isAlphaNum)
import Data.Digest.Pure.SHA import Data.Digest.Pure.SHA
import qualified Data.Map as M import qualified Data.Map as M
import Data.Maybe (fromMaybe) import Data.Maybe (fromMaybe)
import qualified Data.Text.Lazy as T
import Data.Text.Lazy.Encoding (encodeUtf8)
import System.Random (RandomGen, randoms, split) import System.Random (RandomGen, randoms, split)
-- | a mapping of service names to password data -- | a mapping of service names to password data
@ -240,7 +242,7 @@ nextPolicy x p = over pwLength pred $
dec l = over l (max 0 . pred) p dec l = over l (max 0 . pred) p
toUTF8 :: String -> B.ByteString toUTF8 :: String -> B.ByteString
toUTF8 = undefined toUTF8 = encodeUtf8 . T.pack
toB64 :: B.ByteString -> String toB64 :: B.ByteString -> String
toB64 = undefined toB64 = undefined