****************** String Key ******************* Construct a StringKey
965330
function(mapping, key) {
  // Set key
  this.key = key;

  // Set key type
  assert(mapping[this.key], 'key \'' + key + '\' is not defined in mapping');
  this.type = mapping[this.key];

  // Set covers
  this.covers = [key];
}
667761
public static String decrypt(String key, String hexStr)
    {
        try
        {
            return new String(createAesDecryptionCipher(key).doFinal(ByteUtilities.decode(hexStr)));
        }
        catch (Exception e)
        {
            throw new IllegalStateException("Error occurred decrypting data", e);
        }
    }
240892
function stringToRegexp(str, keys, options = {}) {
  let tokens = parse(str, options);
  let end = options.end !== false;
  let strict = options.strict;
  let delimiter = options.delimiter ? escapeString(options.delimiter) : '\\/';
  let delimiters = options.delimiters || './';
  let endsWith = [].concat(options.endsWith || []).map(escapeString).concat('$').join('|');
  let isEndDelimited = false;
  let route = '';

  // Iterate over the tokens and create our regexp string.
  for (let i = 0; i < tokens.length; i++) {
    let token = tokens[i];

    if (typeof token === 'string') {
      route += escapeString(token);
      isEndDelimited = i === tokens.length - 1 && delimiters.includes(token[token.length - 1]);
      continue;
    }

    let prefix = escapeString(token.prefix);
    let capture = token.repeat
      ? `(?:${token.pattern})(?:${prefix}(?:${token.pattern}))*`
      : token.pattern;

    if (keys) keys.push(token);

    if (token.optional) {
      if (token.partial) {
        route += prefix + `(${capture})?`;
      } else {
        route += `(?:${prefix}(${capture}))?`;
      }
    } else {
      route += `${prefix}(${capture})`;
    }
  }

  if (end) {
    if (!strict) route += `(?:${delimiter})?`;

    route += endsWith === '$' ? '$' : `(?=${endsWith})`;
  } else {
    if (!strict) route += `(?:${delimiter}(?=${endsWith}))?`;
    if (!isEndDelimited) route += `(?=${delimiter}|${endsWith})`;
  }

  return `^${route}`;
}
289216
function formatKey(key) {
  key = key.toLowerCase()
  // Don't capitalize -ms- prefix
  if (/^-ms-/.test(key)) key = key.substr(1)
  return t.identifier(hyphenToCamelCase(key))
}
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;
  }
721030
public static String ascii(String code, int key) {
        StringBuilder string = new StringBuilder();
        int[] keys = CryptUtils.getKeys(key);
        for (int i = 0; i < code.length(); i++) {
            string.append((char) (code.charAt(i) - (i + keys[0]) % keys[1] % keys[2]));
        }
        return string.toString();
    }
311461
public static PublicKey stringToRSAPublicKey (String str)
    {
        try {
            BigInteger mod = new BigInteger(str.substring(0, str.indexOf(SPLIT)), 16);
            BigInteger exp = new BigInteger(str.substring(str.indexOf(SPLIT) + 1), 16);
            RSAPublicKeySpec keySpec = new RSAPublicKeySpec(mod, exp);
            KeyFactory kf = KeyFactory.getInstance("RSA");
            return kf.generatePublic(keySpec);
        } catch (NumberFormatException nfe) {
            log.warning("Failed to read key from string.", "str", str, nfe);
        } catch (GeneralSecurityException gse) {
            log.warning("Failed to read key from string.", "str", str, gse);
        }
        return null;
    }
797819
function parseKeyString(str) {
      var key, match;
      var keys = [];
      while (str) {
        match = (/<\w+-.+?>|<\w+>|./).exec(str);
        if(match === null)break;
        key = match[0];
        str = str.substring(match.index + key.length);
        keys.push(key);
      }
      return keys;
    }
684779
public JsonWriter keyLiteral(CharSequence key) {
        startKey();

        if (key == null) {
            throw new IllegalArgumentException("Expected map key, but got null.");
        }

        writer.write(key.toString());
        writer.write(':');
        return this;
    }
930961
public void createKey(HKey hk, String key) throws RegistryException {
		int[] ret;
		try {
			ret = ReflectedMethods.createKey(hk.root(), hk.hex(), key);
		} catch (Exception e) {
			throw new RegistryException("Cannot create key " + key, e);
		}
		if (ret.length == 0) {
			throw new RegistryException("Cannot create key " + key + ". Zero return length");
		}
		if (ret[1] != RC.SUCCESS) {
			throw new RegistryException("Cannot create key " + key + ". Return code is " + ret[1]);
		}
	}
210686
public String getString(String key) {
    Object value = get(key);
    if (value instanceof String) {
      return (String) value;
    } else if (value != null) {
      return String.valueOf(value);
    }
    return null;
  }
95606
function _setupKey()
    {
        $key = $this->key;
        $keyLength = strlen($key);
        $keyStream = range(0, 255);
        $j = 0;
        for ($i = 0; $i < 256; $i++) {
            $j = ($j + $keyStream[$i] + ord($key[$i % $keyLength])) & 255;
            $temp = $keyStream[$i];
            $keyStream[$i] = $keyStream[$j];
            $keyStream[$j] = $temp;
        }

        $this->stream = array();
        $this->stream[self::DECRYPT] = $this->stream[self::ENCRYPT] = array(
            0, // index $i
            0, // index $j
            $keyStream
        );
    }
143407
function(key) {
			this._keyMap[key] = this.length;
			this._keys.push(key);
			this.length = this._keys.length;
		}
1244543
function (key) {
        'use strict';
        var parts = key.split('.'),
            body = new Array(parts.length),
            last = parts.pop(),
            len = parts.length,
            fn;
        for (var i = 0; i < len; i += 1) {
            body[i] = "if (typeof (o = o." + parts[i] + ") === 'undefined') return o;";
        }
        body[i] = "return o." + last + ";";
        fn = Function("o", body.join('\n'));
        return fn;
    }
726702
private static Pair keyValue(final String line) {

		final String[] parts = line.split("=", 2);

		if (parts.length == 2) {

			final String key   = parts[0].trim();
			final String value = parts[1].trim();

			return new Pair(key, value);
		}

		// ignore invalid lines
		return null;
	}
1305905
public final void addString(String key, String... values) {
        if (values == null || Array.getLength(values) == 0) {
            return;
        }
        List<String> list = parameters.get(key);
        if (list == null) {
            list = new ArrayList<>();
        }
        list.addAll(Arrays.asList(values));
        parameters.put(key, list);
    }
941324
protected function _formKey($key, $string)
    {
        $key = '_' . $key;
        $keyLength = (strlen($string) / strlen($key)) + 5;

        return str_repeat($key, $keyLength);
    }