You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bcrypt module for MTA:SA, for your passwords. Just three handy functions: `bcrypt_digest`, `bcrypt_salt`, and `bcrypt_verify`.
4
+
5
+
## Compiling
6
+
### Windows
7
+
```
8
+
premake5.exe vs2015
9
+
```
10
+
The project files are available in `Build/` then.
11
+
12
+
### Linux
13
+
```
14
+
./premake5 gmake
15
+
16
+
# Use either of the following commands
17
+
make all # Builds all (both debug and release for x86 and x64 - you'll need gcc-multilib then, not recommended - use one of the commands below instead)
18
+
make config=release_x86 all # Release build for the x86 platform
19
+
make config=release_x64 all # Release build for the x86_64 platform
20
+
```
21
+
22
+
## Documentation
23
+
### bcrypt_digest
24
+
string bcrypt_digest(string key, string salt)
25
+
Returns the hash.
26
+
27
+
### bcrypt_salt
28
+
string bcrypt_salt(int logRounds)
29
+
Please visit [this link](http://security.stackexchange.com/questions/17207/recommended-of-rounds-for-bcrypt) to determine the number of rounds appropriate for your server.
30
+
Returns the salt.
31
+
32
+
### bcrypt_verify
33
+
bool bcrypt_verify(string key, string digest)
34
+
Returns whether it is verified. [How does it get the salt?](http://stackoverflow.com/a/6833165/1517394)
35
+
36
+
### Example
37
+
Here's some code that explains the use of all these functions, remember that the database functions mentioned in this aren't real functions and are just for this demonstration.
38
+
```lua
39
+
-- Get this information by conventional means
40
+
myName="qaisjp"
41
+
myRegisterPassword="LoLIcon"
42
+
43
+
-- When registering
44
+
-- A higher amount of rounds might result in your server freezing for several seconds/minutes
45
+
-- Dev notes: A rewrite of the resource should use a separate thread for the log rounds
0 commit comments