greater hash size
This commit is contained in:
parent
3e783aafa2
commit
4d4e68ff11
2 changed files with 3 additions and 3 deletions
|
@ -125,7 +125,7 @@ generateThumb raw = do
|
||||||
setImageCompressionQuality w 95
|
setImageCompressionQuality w 95
|
||||||
setImageFormat w "png"
|
setImageFormat w "png"
|
||||||
getImageBlob w
|
getImageBlob w
|
||||||
let h = encode (SHA3.hash 8 thumb)
|
let h = encode (SHA3.hash 24 thumb)
|
||||||
return (thumb, h)
|
return (thumb, h)
|
||||||
|
|
||||||
getGetAvatarR :: AvatarId -> Handler TypedContent
|
getGetAvatarR :: AvatarId -> Handler TypedContent
|
||||||
|
|
|
@ -19,13 +19,13 @@ main = do
|
||||||
dbPasswd <- getPasswd
|
dbPasswd <- getPasswd
|
||||||
let dbString = "host=" ++ dbHost ++ " port=" ++ dbPort ++ " user=" ++ dbUser ++ " dbname=" ++ dbName ++ " password=" ++ dbPasswd
|
let dbString = "host=" ++ dbHost ++ " port=" ++ dbPort ++ " user=" ++ dbUser ++ " dbname=" ++ dbName ++ " password=" ++ dbPasswd
|
||||||
conn <- connectPostgreSQL dbString
|
conn <- connectPostgreSQL dbString
|
||||||
stmt1 <- prepare conn "select * from avatar where hash = 'fill_me!'"
|
stmt1 <- prepare conn "select * from avatar"
|
||||||
_ <- execute stmt1 []
|
_ <- execute stmt1 []
|
||||||
rows <- fetchAllRowsAL stmt1
|
rows <- fetchAllRowsAL stmt1
|
||||||
tups <- return $ map (\entry ->
|
tups <- return $ map (\entry ->
|
||||||
case entry of
|
case entry of
|
||||||
[("id", theId), ("ident", _), ("data", SqlByteString theData), ("hash", _)] ->
|
[("id", theId), ("ident", _), ("data", SqlByteString theData), ("hash", _)] ->
|
||||||
[SqlByteString $ encode $ SHA3.hash 8 theData, theId]
|
[SqlByteString $ encode $ SHA3.hash 24 theData, theId]
|
||||||
_ ->
|
_ ->
|
||||||
error "malformed entry"
|
error "malformed entry"
|
||||||
) rows
|
) rows
|
||||||
|
|
Loading…
Reference in a new issue