Multi-byte str-pad
@param string $input
@param integer $pad_length
@param string $pad_string
@param int $pad_type
@param null $encoding
@return string
4742
public static function mbStringPad($input, $pad_length, $pad_string = ' ', $pad_type = STR_PAD_RIGHT, $encoding = NULL)
    {
        if (!$encoding)
        {
            $diff = strlen($input) - mb_strlen($input);
        }
        else
        {
            $diff = strlen($input) - mb_strlen($input, $encoding);
        }

        return str_pad($input, $pad_length + $diff, $pad_string, $pad_type);
    }
509712
def pad(attrs, inputs, proto_obj):
    
    new_attrs = translation_utils._fix_attribute_names(attrs, {'pads'  : 'pad_width',
                                                               'value' : 'constant_value'
                                                              })
    new_attrs['pad_width'] = translation_utils._pad_sequence_fix(new_attrs.get('pad_width'))
    return 'pad', new_attrs, inputs
262964
protected function pad($src, $pad, $len = 16)
    {
        return substr(hash('sha1', sprintf('%s%s', $src, $pad)), 0, $len);
    }
420394
private String performPadOperation(String source, Integer length, Character padChar, String direction) {
        if (direction.equals("Start")) {
            return Strings.padStart(source, length, padChar);
        } else {
            return Strings.padEnd(source, length, padChar);
        }
    }
220955
public function length($str, $encoding = null)
	{
		$encoding or $encoding = $this->encoding;

		return function_exists('mb_strlen')
			? mb_strlen($str, $encoding)
			: strlen($str);
	}
283992
public function pad($byte_size)
    {
        for ($i = 0; $i < $byte_size; $i++) {
            $this->bb->putByte(--$this->space, "\0");
        }
    }
1314856
static function substring($input, $start, $length = null) {
		return self::substr($input, $start, $length, "utf-8");
	}
521706
public function pad($input, $padLength, $padString, $padType = STR_PAD_RIGHT) {
		$length = mb_strlen($input);
		if ($padLength - $length > 0) {
			switch ($padType) {
				case STR_PAD_LEFT:
					$input = str_repeat($padString, $padLength - $length) . $input;
					break;
				case STR_PAD_RIGHT:
					$input .= str_repeat($padString, $padLength - $length);
					break;
			}
		}
		return $input;
	}
939461
public function padStringFilter($value, $padCharacter, $maxLength, $padType = 'STR_PAD_RIGHT')
    {
        if ($this->isNullOrEmptyString($padCharacter)) {
            throw new \InvalidArgumentException('Pad String Filter cannot accept a null value or empty string as its first argument');
        }
        if ( ! is_int($maxLength)) {
            throw new \InvalidArgumentException('Pad String Filter expects its second argument to be an integer');
        }
        $diff = (function_exists('mb_strlen'))? strlen($value) - mb_strlen($value) : 0;
        $padType = constant($padType);

        return str_pad($value, $maxLength + $diff, $padCharacter, $padType);
    }
905843
private function pad(
        int $length,
        string $character = ' ',
        int $direction = self::PAD_RIGHT
    ): self {
        return new self(\str_pad(
            $this->value,
            $length,
            $character,
            $direction
        ), $this->encoding);
    }
1041339
function pad(num, size) {
	var s = num+"";
	while (s.length < size) {
		s = "0" + s;
	}
	return s;
}
464540
protected function padDynamic($padstr, $length, $type)
    {
        return $this->newInstance(str_pad($this->toString(), $length, $padstr, $type));
    }
1351614
private function pad($string, $block = 32)
    {
        $pad = $block - (strlen($string) % $block);

        return $string . str_repeat(chr($pad), $pad);
    }
362923
public static function padRight(string $str, int $length, string $with = ' ', string $encoding = null) : string
    {
        return static::pad($str, $length, $with, STR_PAD_RIGHT, $encoding);
    }
979477
function(str, pad) {
			var padding = '';
			var il = str.length;
				
			while (pad > il++) padding += '0';
			return padding + str; 
		}
1285733
function pad( str, chr, n ) {
  return (chr.repeat( Math.max( n - str.length, 0 ) ) + str).substr(-n)
}
561826
public function mb_str_pad($input, $pad_length, $pad_string = ' ', $pad_type = STR_PAD_RIGHT)
    {
        $diff = strlen($input) - mb_strlen($input);
        return str_pad($input, $pad_length + $diff, $pad_string, $pad_type);
    }