class StringUtils
deprecated
String utility functions.
static bool | equals(string $knownString, string $userInput) Compares two strings. | |
static int | safeStrlen(string $string) Returns the number of bytes in a string. |
Compares two strings.
This method implements a constant-time algorithm to compare strings. Regardless of the used implementation, it will leak length information.
string | $knownString | The string of known length to compare against |
string | $userInput | The string that the user can control |
bool | true if the two strings are the same, false otherwise |
Returns the number of bytes in a string.
string | $string | The string whose length we wish to obtain |
int |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/Security/Core/Util/StringUtils.html