mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 04:33:05 +00:00
fix issue #450
This commit is contained in:
@@ -885,7 +885,12 @@ int lhmac_sha1(lua_State *L);
|
|||||||
int
|
int
|
||||||
luaopen_crypt(lua_State *L) {
|
luaopen_crypt(lua_State *L) {
|
||||||
luaL_checkversion(L);
|
luaL_checkversion(L);
|
||||||
srandom(time(NULL));
|
static int init = 0;
|
||||||
|
if (!init) {
|
||||||
|
// Don't need call srandom more than once.
|
||||||
|
init = 1 ;
|
||||||
|
srandom(time(NULL));
|
||||||
|
}
|
||||||
luaL_Reg l[] = {
|
luaL_Reg l[] = {
|
||||||
{ "hashkey", lhashkey },
|
{ "hashkey", lhashkey },
|
||||||
{ "randomkey", lrandomkey },
|
{ "randomkey", lrandomkey },
|
||||||
|
|||||||
Reference in New Issue
Block a user