Validates Key Length if key lenght exceeds it will md5 or returns the orginal key

@uses \md5()
@uses \VS_Transient_WP_Api::check_length()

@param string $key

@return string
507157
protected function validate_length( $key = '' ) {
		if ( $this->check_length( $key ) === false ) {
			return $this->validate_length( md5( $key ) );
		}
		return $key;
	}
461551
public function ssize($key)
    {
        try {
            return $this->redis->ssize($key);
        } catch (\RedisException $e) {
            die("Error!: " . $e->getMessage() . "<br/>");
        }
    }
941324
protected function _formKey($key, $string)
    {
        $key = '_' . $key;
        $keyLength = (strlen($string) / strlen($key)) + 5;

        return str_repeat($key, $keyLength);
    }
1102328
protected function validateKey($key)
    {
        if (!is_string($key)) {
            $e = new InvalidArgumentException(sprintf(
                'Cache key must be string, "%s" given', gettype($key)
            ));
            $this->handleException($e, __FUNCTION__);
        }
        if (!isset($key[0])) {
            $e = new InvalidArgumentException('Cache key cannot be an empty string');
            $this->handleException($e, __FUNCTION__);
        }
        if (preg_match('|[\{\}\(\)/\\\@\:]|', $key)) {
            $e = new InvalidArgumentException(sprintf(
                'Invalid key: "%s". The key contains one or more characters reserved for future extension: {}()/\@:',
                $key
            ));
            $this->handleException($e, __FUNCTION__);
        }
    }
527344
protected function processKey($key)
    {
        $key = trim(strtolower($key));
        $key = preg_replace('#[^a-z0-9\.]#', '-', $key) . '~' . $this->keySuffix;

        return $key;
    }
260960
protected static function getConsumerKey($key)
    {

        $len = strlen($key);
        if ($len > 255) {
            $key = 'sha512:' . hash('sha512', $key);
        }

        return $key;

    }
1354071
public function get($key) {
        $key = $this->secureKey($key);
        
        if (isset($_SESSION[$key])) {
            return trim(Text::unlock($_SESSION[$key], $this->sugar()));
        } else {
            return '';
        }
    }
1186861
public function get($key)
    {
        $md5 = md5($key);
        $folderPath = $this->getFolderPathFromMd5($md5);
        $path = $this->path . self::DS . $folderPath . self::DS . $this->prefix . $md5;
        if (!file_exists($path) || !is_readable($path)) {
            return false;
        }

        $content = file_get_contents($path);
        if (!$content) {
            return false;
        }

        $pieces = explode(PHP_EOL, $content);
        if (!is_array($pieces) || !is_numeric($pieces[0])) {
            unlink($path);
            return false;
        }

        $val = @unserialize($pieces[1]);
        if ($val === false) {
            $this->remove($key);
            return false;
        }

        return $val;
    }
725250
protected function hashKey($key)
    {
        if ($key instanceof \DateTime) {
            return md5('_' . $key->format('c'));
        } elseif (is_object($key)) {
            return spl_object_hash($key);
        } elseif (false === $key) {
            return md5('_false');
        } elseif (true === $key) {
            return md5('_true');
        } elseif (null === $key) {
            return md5('_null');
        } elseif (is_array($key)) {
            array_multisort($key);
            return md5(json_encode($key));
        } elseif (is_int($key)) {
            return md5('_' . $key);
        } elseif (is_float($key)) {
            return md5('_' . $key);
        } else {
            return md5(strval($key));
        }
    }
1364128
private static function getNumericKeyValue($key)
    {
        $newKey = \str_replace('np_serializer_element_', '', $key);
        list($type, $index) = \explode('_', $newKey);

        if ('integer' === $type) {
            $index = (int) $index;
        }

        return $index;
    }
137465
public static function key($key): string
    {
        if (!\is_string($key)) {
            $key = \json_encode($key);
        }
        return \preg_replace('/[\W]/', '_', $key);
    }
830721
public function get(string $key)
    {
        $keyMD5 = md5($key);
        $value = $this->dataRepository->getValue($this->keyPrefix . substr($keyMD5, 0, 3) . '/' . substr($keyMD5, 3) . '.2');
        if ($value !== null) {
            try {
                $value = unserialize(gzuncompress($value));
                if ($value[0] > 0) {
                    if ($value[0] > time()) {
                        return $value[1];
                    }
                    return null;
                }
                return $value[1];
            } catch (\Exception $e) {
                
            }
        }
        return null;
    }
752032
protected function _normalizeKey($key)
    {
        try {
            return $this->_normalizeString($key);
        } catch (InvalidArgumentException $e) {
            throw $this->_createOutOfRangeException($this->__('Invalid key'), null, $e, $key);
        }
    }
959014
protected function getPayload($key)
    {
        $path = $this->path($key);

        // If the file doesn't exists, we obviously can't return the cache so we will
        // just return null. Otherwise, we'll get the contents of the file and get
        // the expiration UNIX timestamps from the start of the file's contents.
        try {
            $expire = substr(
                $contents = $this->files->get($path, true), 0, 10
            );
        } catch (Exception $e) {
            return $this->emptyPayload();
        }

        // If the current time is greater than expiration timestamps we will delete
        // the file and return null. This helps clean up the old files and keeps
        // this directory much cleaner for us as old files aren't hanging out.
        if (Carbon::now()->getTimestamp() >= $expire) {
            $this->forget($key);
            return $this->emptyPayload();
        }

        try {
            $data = decrypt(substr($contents, 10));
        } catch (DecryptException $e) {
            $this->forget($key);
            return $this->emptyPayload();
        }

        // Next, we'll extract the number of minutes that are remaining for a cache
        // so that we can properly retain the time for things like the increment
        // operation that may be performed on this cache on a later operation.
        $time = ($expire - Carbon::now()->getTimestamp()) / 60;

        return compact('data', 'time');
    }
1057802
public static function getKeyStatus($key)
    {
        $ch = self::initCurl();

        curl_setopt($ch, CURLOPT_URL, "https://optimize.exactlywww.com/verify/");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt(
            $ch,
            CURLOPT_POSTFIELDS,
            [
            'api_key' => $key
            ]
        );

        // The 403 forbidden is avoided with this line.
        curl_setopt(
            $ch,
            CURLOPT_USERAGENT,
            'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)'
        );

        $response = curl_exec($ch);
        // echo $response;
        if (curl_errno($ch)) {
            throw new \Exception(curl_error($ch));
        }
        curl_close($ch);

        // Possible responses:
        // “great” = verification successful
        // “exceeded” = indicates a valid key with no remaining image credits.
        // an empty response indicates that the key is not valid

        if ($response == '') {
            return 'invalid';
        }
        $responseObj = json_decode($response);
        if (isset($responseObj->error)) {
            if ($responseObj->error == 'invalid') {
                return 'invalid';
            } else {
                throw new \Exception('Ewww returned unexpected error: ' . $response);
            }
        }
        if (!isset($responseObj->status)) {
            throw new \Exception('Ewww returned unexpected response to verify request: ' . $response);
        }
        switch ($responseObj->status) {
            case 'great':
            case 'exceeded':
                return $responseObj->status;
        }
        throw new \Exception('Ewww returned unexpected status to verify request: "' . $responseObj->status . '"');
    }
872592
function sanitize_key( $key ) {
		$raw_key = $key;
		$key = strtolower( $key );
		$key = preg_replace( '/[^a-z0-9_\-]/', '', $key );

		return $key;
	}
1291233
public function getKey(string $key)
    {
        $keys = explode('.', $key);
        $file = array_shift($keys);
        $keys = explode('/', implode('.', $keys));

        if (!isset($this->translations[$file])) {
            $this->addFile($file);
        }

        return $this->findKey($file, $keys);
    }