diff --git a/Handler/Avatar.hs b/Handler/Avatar.hs index b521fb5..67f7bc9 100644 --- a/Handler/Avatar.hs +++ b/Handler/Avatar.hs @@ -125,7 +125,7 @@ generateThumb raw = do setImageCompressionQuality w 95 setImageFormat w "png" getImageBlob w - let h = encode (SHA3.hash 8 thumb) + let h = encode (SHA3.hash 24 thumb) return (thumb, h) getGetAvatarR :: AvatarId -> Handler TypedContent diff --git a/Migration/0.0.0-0.0.1/Migration.hs b/Migration/0.0.0-0.0.1/Migration.hs index e9c037b..93f6f81 100644 --- a/Migration/0.0.0-0.0.1/Migration.hs +++ b/Migration/0.0.0-0.0.1/Migration.hs @@ -19,13 +19,13 @@ main = do dbPasswd <- getPasswd let dbString = "host=" ++ dbHost ++ " port=" ++ dbPort ++ " user=" ++ dbUser ++ " dbname=" ++ dbName ++ " password=" ++ dbPasswd conn <- connectPostgreSQL dbString - stmt1 <- prepare conn "select * from avatar where hash = 'fill_me!'" + stmt1 <- prepare conn "select * from avatar" _ <- execute stmt1 [] rows <- fetchAllRowsAL stmt1 tups <- return $ map (\entry -> case entry of [("id", theId), ("ident", _), ("data", SqlByteString theData), ("hash", _)] -> - [SqlByteString $ encode $ SHA3.hash 8 theData, theId] + [SqlByteString $ encode $ SHA3.hash 24 theData, theId] _ -> error "malformed entry" ) rows