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

Function hash_password

sql/password.c:103–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101*/
102
103void hash_password(ulong *result, const char *password, uint password_len)
104{
105 register ulong nr=1345345333L, add=7, nr2=0x12345671L;
106 ulong tmp;
107 const char *password_end= password + password_len;
108 for (; password < password_end; password++)
109 {
110 if (*password == ' ' || *password == '\t')
111 continue; /* skip space in password */
112 tmp= (ulong) (uchar) *password;
113 nr^= (((nr & 63)+add)*tmp)+ (nr << 8);
114 nr2+=(nr2 << 8) ^ nr;
115 add+=tmp;
116 }
117 result[0]=nr & (((ulong) 1L << 31) -1L); /* Don't use sign bit (str2int) */;
118 result[1]=nr2 & (((ulong) 1L << 31) -1L);
119}
120
121
122/*

Callers 4

seedMethod · 0.85
scramble_323Function · 0.85
check_scramble_323Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected