Sreyas-Sreelal
samp-bcrypt
Rust

A bcrypt plugin for samp.

Last updated Jun 28, 2026
81
Stars
10
Forks
0
Issues
0
Stars/day
Attention Score
11
Language breakdown
Rust 65.5%
Pawn 30.2%
Makefile 4.2%
โ–ธ Files click to expand
README

SampBcrypt

Build sampctl GitHub issues GitHub pull requests GitHub pull license

A bcrypt plugin for samp in Rust.

Installation

sampctl

If you are a sampctl user sampctl install Sreyas-Sreelal/samp-bcrypt

OR

  • Download suitable binary files from releases for your operating system
  • Add it your plugins folder
  • Add sampbcrypt to server.cfg or sampbcrypt.so (for linux)
  • Add samp_bcrypt.inc in includes folder

Building

  • 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

API

  • #### bcrypthash(playerid, const callback[], const input[], cost, const args[] = "", {Float, }:...)
* playerid - id of the player * callback[] - callback to execute after hashing * input[] - string to hash * cost - work factor (4 - 31) * args[] - custom arguments

Example

main() 	{ 		bcrypthash(0, "OnPassswordHash", "text", BCRYPTCOST); 	}

forward OnPassswordHash(playerid); public OnPassswordHash(playerid) { // Hashing completed }

  • #### bcryptgethash(dest[], size = sizeof(hash))
* dest[] - string to store hashed data * size - max size of dest string

Example

main() 	{ 		bcrypthash(0, "OnPassswordHash", "text", BCRYPTCOST); 	}

forward OnPassswordHash(playerid); public OnPassswordHash(playerid) { new dest[BCRYPTHASHLENGTH]; bcryptgethash(dest); printf("hash : %s", dest); }

  • #### bcryptverify(playerid, const callback[], const input[], const hash[], const args[] = "", {Float, }:...)
* playerid - id of the player * callback[] - callback to execute after hashing * input[] - text to compare with hash * hash[] - hash to compare with text * args[] - custom arguments Example
main() 	{ 		bcrypthash(0, "OnPassswordHash", "text", BCRYPTCOST); 	}

forward OnPassswordHash(playerid); public OnPassswordHash(playerid) { new dest[BCRYPTHASHLENGTH]; bcryptgethash(dest); bcrypt_verify(playerid, "OnPassswordVerify", "text", dest); }

forward OnPassswordVerify(playerid, bool:success); public OnPassswordVerify(playerid, bool:success) { // success denotes verifying was successful or not if (success) { // Verified } else { // Hash doesn't match with text } }

  • ### bcryptsetthread_limit(value)
* value - number of worker threads at a time

Example

main() 	{ 		bcryptsetthread_limit(3); 	}

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท Sreyas-Sreelal/samp-bcrypt ยท Updated daily from GitHub