Add PKCS7 padding to a given value.

@param  string  $value
@return string
18538
protected function addPadding($value)
    {
        $pad = $this->block - (strlen($value) % $this->block);

        return $value.str_repeat(chr($pad), $pad);
    }
1158745
public static function prep_value($value) {
		if (\is_array($value)) {
			$value=implode(",", $value);
		}
		if (self::containsCode($value)===false) {
			$value=\str_replace(["\\","\""], ["\\\\","\\\""], $value);
			$value='"'.$value.'"';
		}
		return trim($value,"%");
	}
804906
protected function wrapValue($value)
    {
        if ($value === '*') {
            return $value;
        }

        $value = Str::upper($value);

        return '"' . str_replace('"', '""', $value) . '"';
    }
1076603
public function pad($size, $value)
    {
        $this->items = \array_pad($this->items, $size, $value);

        return $this;
    }
972426
public function appendInt16($value)
    {
        $s = pack("s", $value);
        return $this->append(self::$isLittleEndian ? self::swapEndian16($s) : $s);
    }
821736
public function addIndentationLevel($value)
    {
        $this->indentationLevel = max(0, $this->indentationLevel + (int)$value);

        return $this;
    }
729201
public static function phpize($value)
    {
        $value = (string) $value;
        $lowercaseValue = strtolower($value);

        switch (true) {
            case 'null' === $lowercaseValue:
                return;
            case ctype_digit($value):
                $raw = $value;
                $cast = (int) $value;

                return '0' == $value[0] ? octdec($value) : (((string) $raw === (string) $cast) ? $cast : $raw);
            case isset($value[1]) && '-' === $value[0] && ctype_digit(substr($value, 1)):
                $raw = $value;
                $cast = (int) $value;

                return '0' == $value[1] ? octdec($value) : (((string) $raw === (string) $cast) ? $cast : $raw);
            case 'true' === $lowercaseValue:
                return true;
            case 'false' === $lowercaseValue:
                return false;
            case isset($value[1]) && '0b' == $value[0].$value[1]:
                return bindec($value);
            case is_numeric($value):
                return '0x' === $value[0].$value[1] ? hexdec($value) : (float) $value;
            case preg_match('/^0x[0-9a-f]++$/i', $value):
                return hexdec($value);
            case preg_match('/^(-|\+)?[0-9]+(\.[0-9]+)?$/', $value):
                return (float) $value;
            default:
                return $value;
        }
    }
180954
private function decorateValue($value) : string
    {
        $ret = 'null';
        switch(gettype($value)){
            case 'string':
                $ret = $this->decorateStringValue($value);
                break;
            case 'integer':
            case 'double':
                $ret = $value;
                break;
            case 'boolean':
                $ret = $value ? 'true' : 'false';
                break;
            case 'array':
                $ret = $this->decorateArrayValue($value);
                break;
        }
        return $ret;
    }
1069588
private function hmacSign($value): string
    {
        return hash_hmac(
            HttpConfig::HMAC_ALGORITHM,
            $value,
            $this->encryption->getKey()
        );
    }
244579
public function removePrefixedKeyValues($value)
    {
        if (($pos = strrpos($value, '_')) !== false) {
            return substr($value, ($pos + 1));
        }

        return $value;
    }
761872
public function convertFromUTF7($value)
    {
        if (preg_match('/\+A\w+-?/m', $value)) {
            if (function_exists('mb_convert_encoding')) {
                if (version_compare(PHP_VERSION, '5.2.8', '<')) {
                    $tmp_chars = str_split($value);
                    $value = '';
                    foreach ($tmp_chars as $char) {
                        if (ord($char) <= 127) {
                            $value .= $char;
                        }
                    }
                }
                $value .= "\n" . mb_convert_encoding($value, 'UTF-8', 'UTF-7');
            } else {
                //list of all critical UTF7 codepoints
                $schemes = array(
                    '+ACI-'      => '"',
                    '+ADw-'      => '<',
                    '+AD4-'      => '>',
                    '+AFs-'      => '[',
                    '+AF0-'      => ']',
                    '+AHs-'      => '{',
                    '+AH0-'      => '}',
                    '+AFw-'      => '\\',
                    '+ADs-'      => ';',
                    '+ACM-'      => '#',
                    '+ACY-'      => '&',
                    '+ACU-'      => '%',
                    '+ACQ-'      => '$',
                    '+AD0-'      => '=',
                    '+AGA-'      => '`',
                    '+ALQ-'      => '"',
                    '+IBg-'      => '"',
                    '+IBk-'      => '"',
                    '+AHw-'      => '|',
                    '+ACo-'      => '*',
                    '+AF4-'      => '^',
                    '+ACIAPg-'   => '">',
                    '+ACIAPgA8-' => '">'
                );
                $value = str_ireplace(
                    array_keys($schemes),
                    array_values($schemes),
                    $value
                );
            }
        }
        return $value;
    }
47055
public function appendText($value)
    {
        $text = $this->stringify($value);
        $this->message = $this->message . $text;

        return $this;
    }
107361
protected function serializeHiddenField($value)
    {
        $value = SwatString::signedSerialize($value, $this->salt);

        // escape special characters that confuse browsers (mostly IE;
        // null characters confuse all browsers)
        $value = str_replace('\\', '\\\\', $value);
        $value = str_replace("\x00", '\x00', $value);
        $value = str_replace("\x0a", '\x0a', $value);
        $value = str_replace("\x0d", '\x0d', $value);

        return $value;
    }
565391
private function addPrefixSuffix($value)
    {
        if (!is_null($this->prefix) || !is_null($this->suffix)) {
            return (string) $this->prefix . $value . (string) $this->suffix;
        }

        return $value;
    }
590300
protected function wrapValue($value)
    {
        if ($this->isReserved($value)) {
            return Str::upper(parent::wrapValue($value));
        }

        return $value !== '*' ? sprintf($this->wrapper, $value) : $value;
    }
1217739
private function pemDataClean($value)
    {
        $value = str_ireplace('-----BEGIN EC PRIVATE KEY-----', '', $value);
        $value = str_ireplace('-----END EC PRIVATE KEY-----', '', $value);
        $value = str_ireplace("\r", '', trim($value));
        $value = str_ireplace("\n", '', trim($value));
        $value = str_ireplace(' ', '', trim($value));

        return $value;
    }
183280
private function studly($value)
    {
        $key = $value;

        $value = ucwords(str_replace(['-', '_'], ' ', $value));

        return str_replace(' ', '', $value);
    }