Installer avec sampctl
sampctl package install Sreyas-Sreelal/samp-bcrypt
Lance ceci dans le dossier de ton projet. sampctl télécharge le paquet et ce dont il dépend.
Ajoute ses fichiers include, avec les bibliothèques dont il dépend, au compilateur Pawn de ton navigateur, prêts à être inclus dans un script.
Dépend de 1 paquet
- sampctl/pawn-stdlibpas dans cet annuaire
Utilisé par 17 paquets
- PatrickGTR/gta-open★ 85
- DignitySAMP/SP-RP★ 54
- ZantetsukenGT/AttDef★ 16
- DignitySAMP/medieval-roleplay★ 16
- DignitySAMP/Wild-West-Roleplay★ 11
- DignitySAMP/godfather-gamemode★ 9
- revolutionmp/revolution★ 7
- knryuu/pawnplus-bcrypt-next★ 7
- Quante31/samp-server-mod★ 2
- pawn-id/sampctl-gamemode-template★ 2
- shisisan/samp-gamemode-template★ 2
- NeekoGta/San-Andreas-Multimode★ 1
- jvson03/samp-narcotic★ 1
- Se8870/pp-bcrypt★ 1
- Abielfrl/S-RP★ 1
- jizzydotb/AttDef★ 1
- sklawik/szkodnik-rp★ 0
README.md
SampBcrypt
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
pluginsfolder - Add
samp_bcryptto server.cfg orsamp_bcrypt.so(for linux) - Add samp_bcrypt.inc in includes folder
Building
Clone the repo
git clone https://github.com/Sreyas-Sreelal/samp-bcrypt.gitSetup testing server
make setupBuild using makefile
make releasefor release buildsmake debugfor debug buildsRun the tests
make run
API
bcrypt_hash(playerid, const callback[], const input[], cost, const args[] = "", {Float, _}:...)
playerid- id of the playercallback[]- callback to execute after hashinginput[]- string to hashcost- work factor (4 - 31)args[]- custom arguments
Example
main() { bcrypt_hash(0, "OnPassswordHash", "text", BCRYPT_COST); } forward OnPassswordHash(playerid); public OnPassswordHash(playerid) { // Hashing completed }bcrypt_get_hash(dest[], size = sizeof(hash))
dest[]- string to store hashed datasize- max size of dest string
Example
main() { bcrypt_hash(0, "OnPassswordHash", "text", BCRYPT_COST); } forward OnPassswordHash(playerid); public OnPassswordHash(playerid) { new dest[BCRYPT_HASH_LENGTH]; bcrypt_get_hash(dest); printf("hash : %s", dest); }bcrypt_verify(playerid, const callback[], const input[], const hash[], const args[] = "", {Float, _}:...)
playerid- id of the playercallback[]- callback to execute after hashinginput[]- text to compare with hashhash[]- hash to compare with textargs[]- custom arguments
Example
main() { bcrypt_hash(0, "OnPassswordHash", "text", BCRYPT_COST); } forward OnPassswordHash(playerid); public OnPassswordHash(playerid) { new dest[BCRYPT_HASH_LENGTH]; bcrypt_get_hash(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 } }bcrypt_set_thread_limit(value)
value- number of worker threads at a time
Example
main() { bcrypt_set_thread_limit(3); }
bcrypthashingpassword-hashpawn-packagepluginrustsa-mpsa-mp-pluginsamp
Cette page est construite à partir de ce que GitHub publie sur le dépôt. samp.directory n’héberge pas le code. Signaler un problème avec cette fiche