WEBQQ hash value for C # method 2014/06/20

Source: Internet
Author: User

Last year's whim, the use of leisure time to do a webqq desktop software, the basic ability to achieve, then put there. WEBQQ protocol constantly updated, resulting in some parameter encryption method to update, today, a friend in the group to provide a new webqq hash js, I turned into a C # method, recorded here, I hope to be doing webqq friends help.

JS method

p=Getqqhsahs (b,j) { for(varA = j + "Password Error", I= "", E= [];;)if(I.length <=a.length) {if(i + = b, i.length = = a.length) Break            } Else{i= I.slice (0, a.length);  Break            }             for(varc = 0; c < i.length; C + +) E[c] = I.charcodeat (c) ^A.charcodeat (c); A= ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; I= "";  for(c = 0; c < e.length; C + +) i + = A[e[c] >> 4 & 15], I+ = A[e[c] & 15]; returni}

Turn into C # method

 Public stringGethash (UINTBstringj) {varA = j +"Password Error"; vari =""; varE =Newlist<int>();  while(true)            {                if(I.length <=a.length) {i+=b; if(I.length = =a.length) Break; }                Else{i= I.substring (0, a.length);  Break; }            }            Char[] Ichars =I.tochararray (); Char[] Achars =A.tochararray ();  for(varc =0; c < i.length; C++) E.add ( (int) Ichars[c] ^ (int) (Achars[c])); string[] A1 =New string[] {"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F" }; I="";  for(varc =0; c < E.count; C++) {i+ = a1[(int) E[c] >>4& the]; I+ = a1[(int) E[c] & the]; }            returni; }

The return data of the code has been compared with JS, can be used; Since my own webqq has not been updated for a long time, this method has not been tested in the WEBQQ project, and the data that is encountered and JS processed in the use is inconsistent, please leave a message to inform.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.