Skip to content

MauriceButler/godot-bcrypt

Repository files navigation

godot-bcrypt

Godot bindings as a wrapper for bcrypt

Dependencies

  1. Fetch sub modules (godot-cpp and libbcrypt) by running
git submodule update --init --recursive

Compile godot-cpp

To 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

Compile libbcrypt

cd libbcrypt
mkdir build
cd build
cmake ..
make
cd ..

Compile godot-bcrypt

Once the dependencies have been compiled, to build this library just run

scons

This will compile the library and place it in the bcryptDemo/bin directory, along with the godotBcrypt.gdextension file

Using the library

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.

image

About

Godot bindings as a wrapper for bcrypt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published