MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / init

Method init

sql/sql_crypt.cc:29–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27#include "password.h"
28
29void SQL_CRYPT::init(ulong *rand_nr)
30{
31 uint i;
32 randominit(&rand,rand_nr[0],rand_nr[1]);
33
34 for (i=0 ; i<=255; i++)
35 decode_buff[i]= (char) i;
36
37 for (i=0 ; i<= 255 ; i++)
38 {
39 int idx= (uint) (my_rnd(&rand)*255.0);
40 char a= decode_buff[idx];
41 decode_buff[idx]= decode_buff[i];
42 decode_buff[+i]=a;
43 }
44 for (i=0 ; i <= 255 ; i++)
45 encode_buff[(uchar) decode_buff[i]]=i;
46 org_rand=rand;
47 shift=0;
48}
49
50
51void SQL_CRYPT::encode(char *str,uint length)

Callers

nothing calls this directly

Calls 2

randominitFunction · 0.85
my_rndFunction · 0.85

Tested by

no test coverage detected