Public paste
Undefined
By: Guest | Date: Nov 20 2009 16:51 | Format: None | Expires: never | Size: 1.02 KB | Hits: 862

  1. int GetStrValue(char Str[255])
  2. {
  3.         int iValue;
  4.         int aValue[62] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x60, 0x61, 0x62};
  5.         const char cPossibleChars[62] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
  6.         for(int i = 0; i < strlen((const char *)Str); i++)
  7.         {
  8.                 for(int j = 0; j < strlen(cPossibleChars); j++)
  9.                 {
  10.                         if(Str[i] == cPossibleChars[j])
  11.                         {
  12.                                 iValue += (aValue[j] * j);
  13.                                 //iValue += aValue[j];
  14.                         }
  15.                 }
  16.         }
  17.         return iValue * 3142;
  18. }