[Plugin] Bcrypt
#15

I decided to use std::lock_guard to overcome the issue with vector's thread safety. It seemed the most suitable and secure solution (unlocks even on exceptions)

Quote:
Originally Posted by Dan..
View Post
Suggestions:

http://www.boost.org/doc/libs/1_54_0...free.queue_hpp

Don't use more than 2 threads.

Implement a blocking function aswell for those having powerful servers.

Make `cost` a default parameter. Also, playerid parameter is useless, you'd better add an "threadidex" parameter.
pawn Code:
native bcrypt_hash(threadid, threadidex, password[], cost = 4);
Also, this means that you have to change the callback:
pawn Code:
forward OnBcryptHashed(threadid, threadidex, password[], hash[]);
Thanks for the suggestions.

I added the default cost and changed playerid to thread_idx.

About limiting the amount of threads used to 2: Why should this be done? Does it increase stability?
Reply


Messages In This Thread
Bcrypt (Password hash) - by Johnson_boy - 25.07.2013, 12:59
AW: Bcrypt - by Poket-Jony - 25.07.2013, 13:02
Re: Bcrypt - by Djole1337 - 25.07.2013, 13:17
Re: Bcrypt - by roschti - 25.07.2013, 13:52
AW: Bcrypt - by BigETI - 25.07.2013, 14:24
Re: Bcrypt - by Johnson_boy - 25.07.2013, 14:30
Re: Bcrypt - by Johnson_boy - 25.07.2013, 16:33
Re: Bcrypt - by Edvin - 25.07.2013, 17:54
Re: Bcrypt - by Maxips2 - 25.07.2013, 19:30
AW: Bcrypt - by BigETI - 25.07.2013, 20:37
Re: AW: Bcrypt - by Johnson_boy - 25.07.2013, 21:59
Re: Bcrypt - by Red_Dragon. - 26.07.2013, 03:09
Re: Bcrypt - by Dan.. - 26.07.2013, 07:12
Re: Bcrypt - by Niko_boy - 26.07.2013, 07:20
Re: Bcrypt - by Johnson_boy - 26.07.2013, 17:23
Re: Bcrypt - by Dan.. - 26.07.2013, 18:27
AW: Re: Bcrypt - by BigETI - 26.07.2013, 23:32
Re: Bcrypt - by Lorenc_ - 27.07.2013, 01:43
Re: Bcrypt - by Dan.. - 27.07.2013, 07:51
Re: Bcrypt - by Johnson_boy - 28.07.2013, 12:10
Re: Bcrypt - by Johnson_boy - 06.08.2013, 23:45
Respuesta: Bcrypt - by GutierrezDeVelasco - 25.01.2014, 21:40
Respuesta: Bcrypt - by GutierrezDeVelasco - 25.01.2014, 21:49
Re: Bcrypt - by Kaperstone - 20.07.2014, 22:10
Re: Bcrypt - by Johnson_boy - 21.07.2014, 08:11
Re: Bcrypt - by maddinat0r - 21.07.2014, 20:07
Re: Bcrypt - by Sonical - 28.07.2014, 20:44
Re: Bcrypt - by Kaperstone - 28.08.2014, 23:30
Re: Bcrypt - by Kaperstone - 18.11.2014, 02:50
Re: Bcrypt - by Johnson_boy - 20.11.2014, 22:03
Re: Bcrypt - by Kaperstone - 21.11.2014, 04:49
Re : Bcrypt - by Maxime_Creteur - 25.11.2014, 18:21
Re : Bcrypt - by Nealll - 28.11.2014, 18:48
Re: Re : Bcrypt - by Johnson_boy - 28.11.2014, 20:35
Re : Bcrypt - by Nealll - 29.11.2014, 06:40
Re: Bcrypt - by Kaperstone - 01.12.2014, 13:33
Re : Bcrypt - by Nealll - 01.12.2014, 15:49
Re: Bcrypt - by Johnson_boy - 01.12.2014, 23:49
Re: Bcrypt - by ProKillerpa - 01.12.2014, 23:51
Re : Bcrypt - by Nealll - 02.12.2014, 18:20

Forum Jump:


Users browsing this thread: 7 Guest(s)