-import Data.List (nub, tails, null)
-import Data.Hash.MD5 (md5s, Str(..))
-
+import Data.List (nub, tails)
import Data.ByteString.Char8 (pack)
import Crypto.Hash (hash, Digest, MD5)
import Data.ByteString.Char8 (pack)
import Crypto.Hash (hash, Digest, MD5)
-possibleStart :: [String] -> Int-> Bool
--- possibleStart s i = not $ null $ repeats 3 $ s!!i
-possibleStart s = not . null . repeats 3 . ((!!) s)
+possibleKey :: [String] -> Int-> Bool
+possibleKey s = not . null . repeats 3 . ((!!) s)
-confirmStart :: [String] -> Int -> Bool
-confirmStart s i = any (confirmation) $ take 1000 $ drop (i+1) s
+confirmKey :: [String] -> Int -> Bool
+confirmKey s i = any (confirmation) $ take 1000 $ drop (i+1) s
repeats :: Int -> String -> [String]
repeats n = filter (null . tail) . map (nub) . substrings n
substrings :: Int -> [a] -> [[a]]
substrings l = filter (\s -> (length s) == l) . map (take l) . tails
repeats :: Int -> String -> [String]
repeats n = filter (null . tail) . map (nub) . substrings n
substrings :: Int -> [a] -> [[a]]
substrings l = filter (\s -> (length s) == l) . map (take l) . tails