将key中的每一个ascii字符转为整数
357373
private function convert($key)
    {
        $_key = array(16);
        for ($i = 0; $i < 16; $i++) {
            $_key[$i] = ord($key[$i]); //转化为数字字符串，每一元素代表一个字节的整数
        }
        return $_key;
    }
1129466
def _encode_key(self, key):
        
        if isinstance(key, str) or isinstance(key, unicode):
            key = key.encode(self._keyencoding)
        elif not isinstance(key, bytes):
            raise TypeError("key must be bytes or str")
        return codecs.encode(key, 'hex_codec').decode(self._keyencoding)
357614
public static String ascii(String code, String key) {
        return ascii(code, CryptUtils.stringToKey(key));
    }
341915
def t(key, options = {})
      if (val = super) =~ /class.+?translation_missing/
        val = val.to_s.gsub(/<span[^>]*>/, 'i18n: ').gsub('</span>', '').gsub(', ', '.')
      end

      val
    end
841543
public static int[] getKeys(int key) {
        int[] keys = {0, 1, 1};
        if (key > 0) {
            // 自定义算Key
            if (key < TEN) {
                keys[0] = key;
                keys[1] = key - key / 2;
                keys[2] = Math.abs(keys[1] - key % keys[1]);
            } else if (key < HUNDRED) {
                keys[0] = key % 10;
                keys[1] = Math.abs(key / 10 - keys[0]) % 9 + 1;
                keys[2] = keys[0] * keys[1] / (keys[0] + keys[1]) % 10;
            } else if (key < THOUSAND) {
                int middle = key % 100 / 10;
                keys[0] = key % 10;
                keys[1] = key / 100;
                keys[2] = ((int) (Math.pow(keys[1], keys[0]) / middle) % 9 + 1);
            } else {
                int length = String.valueOf(key).length();
                keys[0] = key % 10;
                keys[1] = key / (int) Math.pow(10, length - 1);
                length = (keys[0] + keys[1] + keys[0] * keys[1]) % (length - 2) + 2;
                keys[2] = (int) (key % Math.pow(10, length) / Math.pow(10, length - 1));
            }
            keys[2] = keys[2] % 8 + 2;
        }
        return keys;
    }
1120329
private static String formatKey(String prjKey) {
        String formatKey = prjKey;
        if (prjKey.startsWith("+")) {
            formatKey = prjKey.substring(1);
        }
        return formatKey;
    }
406212
protected String keyToString(Object rawKey)
    {
        if (rawKey instanceof String) {
            return (String) rawKey;
        }
        return String.valueOf(rawKey);
    }
141529
public byte[] wrapKeyByKey(Key key,Key wrapKey)
	{
		try {
    		if(key==null ||wrapKey==null)
    		{
    			return null;
    		}
			Cipher cipher=Cipher.getInstance(algorithm);
			//使用私钥包裹模式
			cipher.init(Cipher.WRAP_MODE,wrapKey);
			return cipher.wrap(key);
		} catch (Exception e) {
			log.error(e.getMessage(),e);
		}
    	return null;
	}
1300339
static Key str2Key(String s) {
    Key k = str2Key_impl(s);
    assert key2Str_impl(k, decodeType(s)).equals(s) : "bijection fail " + s + " <-> " + k;
    return k;
  }
710783
public void key( String skey ) throws jsqlite.Exception {
        synchronized (this) {
            byte ekey[] = null;
            if (skey != null && skey.length() > 0) {
                ekey = new byte[skey.length()];
                for( int i = 0; i < skey.length(); i++ ) {
                    char c = skey.charAt(i);
                    ekey[i] = (byte) ((c & 0xff) ^ (c >> 8));
                }
            }
            _key(ekey);
        }
    }
1252270
function mapKeyCodeToKey(sKeyCode) {

		// look up number in KeyCodes enum to get the string
		if (!isNaN(sKeyCode)) {
			sKeyCode = getKeyCodeStringFromNumber(sKeyCode);
		}
		if (!sKeyCode) {
			return undefined;
		}
		sKeyCode = sKeyCode.toLowerCase();
		// replace underscores with dash character such as 'ARROW_LEFT' --> 'ARROW-LEFT' and then camelize it --> 'ArrowLeft'
		sKeyCode = camelize(sKeyCode.replace(/_/g, "-"));

		// capitalize key
		var sKey = capitalize(sKeyCode);

		// remove "Digit" and "Numpad" from the resulting string as this info is present within the Location property and not the key property
		// e.g. "Digit9" --> "9"
		if (sKey.startsWith("Digit")) {
			return sKey.substring("Digit".length);
		} else if (sKey.startsWith("Numpad")) {
			sKey = sKey.substring("Numpad".length);
		}

		// special handling where KeyCodes[sKeyCode] does not match
		// e.g. KeyCodes.BREAK --> 'Pause' instead of 'Break'
		switch (sKey) {
			case "Break": return "Pause";
			case "Space": return " ";
			case "Print": return "PrintScreen";
			case "Windows": return "Meta";
			case "Sleep": return "Standby";
			case "TurnOff": return "PowerOff";
			case "Asterisk": return "*";
			case "Plus": return "+";
			case "Minus": return "-";
			case "Comma": return ",";
			case "Slash": return "/";
			case "OpenBracket": return ";";
			case "Dot": return ".";
			case "Pipe": return "|";
			case "Semicolon": return ";";
			case "Equals": return "=";
			case "SingleQUote": return "=";
			case "Backslash": return "\\";
			case "GreatAccent": return "`";
			default: return sKey;
		}
	}
1162452
private function hex($ascii)
    {
        $str = dechex(ord($ascii));
        if (!isset($str[1])) {
            $str = '0' . $str; //补位
        }
        return $str;
    }
955053
private String processKey(String key) {
        AssertUtils.assertNotNull(key, "Key cannot be null");

        String result = null;

        if (this.isCaseSensitive() == false) {
            result = key.toLowerCase(Locale.ENGLISH);
        } else {
            result = key;
        }

        return result;
    }
189169
def _decode_key(self, key):
        
        bkey = codecs.decode(key.encode(self._keyencoding), 'hex_codec')
        return bkey.decode(self._keyencoding) if self._serialize else bkey
389520
function () {
            var random = Math.random(),
                randomStr = random.toString( 32 ).substr( 2 ),
                alphabet = Math.round( Math.random() * 21 + 10 ).toString( 32 );//a~v
    
            if ( randomStr.length < 2 ) randomStr = 'i' + alphabet + 'x' + alphabet + 'b' + alphabet + 'a' + alphabet + 'n' + alphabet + 'd';
            var result = alphabet + __keyCount.toString( 32 ) + randomStr + randomStr + randomStr + randomStr;
            __keyCount++;
            return result.substr( 0, 15 ) + alphabet;
        }
740239
def prettykey(self, key):
        
        f = list(self.decodekey(key))
        f[0] = f[0].decode('utf-8')
        if len(f) > 2 and type(f[2]) == bytes:
            f[2] = f[2].decode('utf-8')

        if f[0] == '.':
            if len(f) == 2:
                return "%s%16x" % tuple(f)
            elif len(f) == 3:
                return "%s%16x %s" % tuple(f)
            elif len(f) == 4:
                if f[2] == 'H' and type(f[3]) in (str, bytes):
                    f[3] = f[3].decode('utf-8')
                    return "%s%16x %s '%s'" % tuple(f)
                elif type(f[3]) in (int, long):
                    return "%s%16x %s %x" % tuple(f)
                else:
                    f[3] = hexdump(f[3])
                    return "%s%16x %s %s" % tuple(f)
        elif f[0] in ('N', 'n', '$'):
            if type(f[1]) in (int, long):
                return "%s %x %16x" % tuple(f)
            else:
                return "%s'%s'" % tuple(f)
        elif f[0] == '-':
            return "%s %x" % tuple(f)

        return hexdump(key)
1160391
function (ascii) {
			var asciiArray = ascii.split(",");
			var parsedString = "";

			jQuery.each(asciiArray, function (index, asciiChar) {
				parsedString += String.fromCharCode(asciiChar);
			});

			return parsedString;

		}