A bcrypt plugin for samp in Rust.
A bcrypt plugin for samp in Rust.
If you are a sampctl user
sampctl install Sreyas-Sreelal/samp-bcrypt
plugins
foldersamp_bcrypt
to server.cfg or samp_bcrypt.so
(for linux)Clone the repo
git clone https://github.com/Sreyas-Sreelal/samp-bcrypt.git
Setup testing server
make setup
Build using makefile
make release
for release builds
make debug
for debug builds
Run the tests
make run
playerid
- id of the playercallback[]
- callback to execute after hashinginput[]
- string to hashcost
- work factor (4 - 31)args[]
- custom argumentsExample
ain()
bcrypt_hash(0, "OnPassswordHash", "text", BCRYPT_COST);
orward OnPassswordHash(playerid);
ublic OnPassswordHash(playerid)
// Hashing completed
dest[]
- string to store hashed datasize
- max size of dest stringExample
ain()
bcrypt_hash(0, "OnPassswordHash", "text", BCRYPT_COST);
orward OnPassswordHash(playerid);
ublic OnPassswordHash(playerid)
new dest[BCRYPT_HASH_LENGTH];
bcrypt_get_hash(dest);
printf("hash : %s", dest);
playerid
- id of the playercallback[]
- callback to execute after hashinginput[]
- text to compare with hashhash[]
- hash to compare with textargs[]
- custom argumentsExample
ain()
bcrypt_hash(0, "OnPassswordHash", "text", BCRYPT_COST);
orward OnPassswordHash(playerid);
ublic OnPassswordHash(playerid)
new dest[BCRYPT_HASH_LENGTH];
bcrypt_get_hash(dest);
bcrypt_verify(playerid, "OnPassswordVerify", "text", dest);
orward OnPassswordVerify(playerid, bool:success);
ublic OnPassswordVerify(playerid, bool:success)
// success denotes verifying was successful or not
if (success)
{
// Verified
}
else
{
// Hash doesn't match with text
}
value
- number of worker threads at a timeExample
ain()
bcrypt_set_thread_limit(3);