Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 35 // psi-0.12/src/common.cpp:113:QString encodePassword(const QString &pass, const QString &key)
- 36 QString encodePassword(const QString &pass, const QString &key)
- 37 {
- 38 QString result;
- 39 int n1, n2;
- 40
- 41 if(key.length() == 0)
- 42 return pass;
- 43
- 44 for(n1 = 0, n2 = 0; n1 < pass.length(); ++n1) {
- 45 ushort x = pass.at(n1).unicode() ^ key.at(n2++).unicode();
- 46 QString hex;
- 47 hex.sprintf("%04x", x);
- 48 result += hex;
- 49 if(n2 >= key.length())
- 50 n2 = 0;
- 51 }
- 52 return result;
- 53 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement