(PHP 7 >= 7.2.0, PHP 8)
sodium_pad — Add padding data
sodium_pad(#[\SensitiveParameter] string $string, int $block_size): string
Right-pad a string to a desired length. Timing-safe.
stringUnpadded string.
block_sizeThe string will be padded until it is an even multiple of the block size.
Padded string.
© 1997–2025 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/function.sodium-pad.php