Godot bindings as a wrapper for bcrypt
git submodule update --init --recursiveTo generate and compile the bindings, use this command (replacing with linux, macos, windows, android, ios or javascript depending on your OS / target).
cd godot-cpp
scons platform=<platform> generate_bindings=yes
cd ..For more detailed instructions and options checkout the offical documentation
cd libbcrypt
mkdir build
cd build
cmake ..
make
cd ..Once the dependencies have been compiled, to build this library just run
sconsThis will compile the library and place it in the bcryptDemo/bin directory, along with the godotBcrypt.gdextension file
Once thats done, open the bcryptDemo application in Godot, and open the bcryptDemo.gd file to see the usage.
var password = "SuperSecretPassword"
var hash1 = GodotBcrypt.hash(password)
var hash2 = GodotBcrypt.hash(password, 15)
print("Password: ", password)
print("Hash1: ", hash1)
print("Hash2: ", hash2)
print("Matches hash1: ", GodotBcrypt.compare(password, hash1))
print("Matches hash2: ", GodotBcrypt.compare(password, hash2))
print("Matches incorrect password: ", GodotBcrypt.compare("IncorrectPassword", hash1))
print("Matches incorrect hash: ", GodotBcrypt.compare(password, "IncorrectHash"))Run the application to see the output.
