mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
more random seed
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define SMALL_CHUNK 256
|
||||
|
||||
@@ -960,7 +961,7 @@ luaopen_skynet_crypt(lua_State *L) {
|
||||
if (!init) {
|
||||
// Don't need call srandom more than once.
|
||||
init = 1 ;
|
||||
srandom(time(NULL));
|
||||
srandom((time(NULL) << 16) ^ getpid());
|
||||
}
|
||||
luaL_Reg l[] = {
|
||||
{ "hashkey", lhashkey },
|
||||
|
||||
Reference in New Issue
Block a user