lua-bcrypt

Secure password hashing for Lua
Log | Files | Refs

commit 0deb1b2fc717bf0acdbf4b45c50d00f0dd40e964
parent 4679b73f8357073e5612634e08afb2a6629102e8
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Tue, 31 Jul 2012 13:21:37 +0100

Rename bcrypt.gensalt to bcrypt.salt

Diffstat:
README.md | 2+-
src/luabcrypt.c | 6+++---
tests.lua | 2+-
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md @@ -13,7 +13,7 @@ Usage require( "bcrypt" ) - local salt = bcrypt.gensalt( 5 ) + local salt = bcrypt.salt( 5 ) local digest = bcrypt.digest( "password", salt ) assert( bcrypt.verify( "password", digest ) ) diff --git a/src/luabcrypt.c b/src/luabcrypt.c @@ -21,8 +21,8 @@ static int luabcrypt_digest( lua_State *L ) return 1; } -// bcrypt.gensalt( logRounds ) -static int luabcrypt_gensalt( lua_State *L ) +// bcrypt.salt( logRounds ) +static int luabcrypt_salt( lua_State *L ) { u_int8_t log_rounds = luaL_checkinteger( L, 1 ); @@ -54,7 +54,7 @@ static int luabcrypt_verify( lua_State *L ) struct luaL_reg luabcrypt_lib[] = { { "digest", luabcrypt_digest }, - { "gensalt", luabcrypt_gensalt }, + { "salt", luabcrypt_salt }, { "verify", luabcrypt_verify }, { NULL, NULL }, }; diff --git a/tests.lua b/tests.lua @@ -1,6 +1,6 @@ require( "bcrypt" ) -local salt = bcrypt.gensalt( 5 ) +local salt = bcrypt.salt( 5 ) assert( salt:len() == 29 ) local digest = bcrypt.digest( salt, salt )