knop-project / knop

Web application framework for Lasso 8 and 9
18 stars 46 forks source link

knop_crypthash - Set default cost to a random value between 8000 and 12000 #113

Open stevepiercy opened 9 years ago

stevepiercy commented 9 years ago

In the type definition for knop_crypthash, make cost an optional integer.

cost::integer = 1

Then override the default value with a random value.

#_cost == 1 ? #_cost = integer_random(8000, 12000)

Thus the user can calculate their own cost and pass it in or let Knop set it.