Skip to content

Commit

Permalink
Merge pull request #4 from stefan-hoeck/style
Browse files Browse the repository at this point in the history
[ style ] adhere to coding style
  • Loading branch information
stefan-hoeck authored Aug 20, 2023
2 parents 63f68a0 + b829041 commit 15866ef
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/Text/Crypt.idr
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,15 @@ gensalt :
-> {auto 0 prf : InRange cm cost}
-> IO String
gensalt cm cost = fromPrim (go 100)
where go : Nat -> PrimIO String
go Z w = prim__gensalt (cryptPrefix cm) cost w
go (S n) w =
let MkIORes str w2 := prim__gensalt (cryptPrefix cm) cost w
in case checksalt str of
Invalid => go n w2
_ => MkIORes str w2

where
go : Nat -> PrimIO String
go Z w = prim__gensalt (cryptPrefix cm) cost w
go (S n) w =
let MkIORes str w2 := prim__gensalt (cryptPrefix cm) cost w
in case checksalt str of
Invalid => go n w2
_ => MkIORes str w2

||| Hash the given passphrase with the given salt.
||| Usually, it is best to generate a new salt when hashing
Expand Down

0 comments on commit 15866ef

Please sign in to comment.