This article mainly introduces the QQ space g_tk encryption algorithm implemented by PHP, which involves php Character String Conversion Techniques and has some reference value. For more information, see
This article mainly introduces the QQ space g_tk encryption algorithm implemented by PHP, which involves php Character String Conversion Techniques and has some reference value. For more information, see
This example describes the g_tk encryption algorithm of the QQ space implemented by PHP. Share it with you for your reference. The details are as follows:
// G_tk compute function getGTK ($ skey) {$ hash = 5381; for ($ I = 0; $ I << 5) utf8_unicode($skey[$i]); } return $hash & 0x7fffffff;}function utf8_unicode($c) { switch(strlen($c)) {case 1:return ord($c);case 2:$n="(ord($c[0])" 0x3f) 6;$n 0x3f;return $n;case 3:$n="(ord($c[0])" 0x1f) 12;$n 4:$n="(ord($c[0])" 0x0f) 18;$n $n; }}< p>
I hope this article will help you with php programming.
,