Skip to content

Instantly share code, notes, and snippets.

@NickNaso
Created December 24, 2017 22:35
Show Gist options
  • Save NickNaso/c97df8ef7482bf3202520bf0af87d1cd to your computer and use it in GitHub Desktop.
Save NickNaso/c97df8ef7482bf3202520bf0af87d1cd to your computer and use it in GitHub Desktop.
bcrypt-napi init
Napi::Object init(Napi::Env env, Napi::Object exports) {
exports.Set(Napi::String::New(env, "gen_salt_sync"), Napi::Function::New(env, GenerateSaltSync));
exports.Set(Napi::String::New(env, "encrypt_sync"), Napi::Function::New(env, EncryptSync));
exports.Set(Napi::String::New(env, "compare_sync"), Napi::Function::New(env, CompareSync));
exports.Set(Napi::String::New(env, "get_rounds"), Napi::Function::New(env, GetRounds));
exports.Set(Napi::String::New(env, "gen_salt"), Napi::Function::New(env, GenerateSalt));
exports.Set(Napi::String::New(env, "encrypt"), Napi::Function::New(env, Encrypt));
exports.Set(Napi::String::New(env, "compare"), Napi::Function::New(env, Compare));
return exports;
};
NODE_API_MODULE(bcrypt_napi, init);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment