0 | module Crypto.BCrypt.Types
 1 |
 2 | import Derive.Prelude
 3 |
 4 | %language ElabReflection
 5 |
 6 | ||| The bcrypt work factor.
 7 | |||
 8 | ||| The work factor determines the computational cost of hashing a password.
 9 | |||
10 | ||| Each increment approximately doubles the amount of work required to compute and verify a bcrypt hash.
11 | |||
12 | ||| Valid bcrypt work factors are in the range 4 to 31 inclusive.
13 | |||
14 | ||| Values outside this range are handled according to the underlying libbcrypt implementation.
15 | |||
16 | public export
17 | record WorkFactor where
18 |     constructor MkWorkFactor
19 |     value : Bits8
20 |
21 | %runElab derive "WorkFactor" [Show,Eq,Ord] 
22 |