test-client-godot/modules/crypt/crypt.cpp
2020-01-24 19:56:51 +01:00

30 lines
523 B
C++

/*
Module to encrypt message with sha512 method
*/
#include "crypt.h"
#include "sha512crypt.h"
void Crypt::_bind_methods() {
ClassDB::bind_method(D_METHOD("encrypt", "key", "salt") , &Crypt::encrypt);
}
Crypt::Crypt() {
}
Crypt::~Crypt() {
// add your cleanup here
}
void Crypt::_init() {
// initialize any variables here
}
String Crypt::encrypt(String key, String salt) {
String out = "";
char * res = sha512_crypt (key.ascii().get_data(), salt.ascii().get_data());
out = res;
return out;
}