Documentation

BinaryString
in package

Table of Contents

Methods

constantTimeCompare()  : bool
Equivalent to hash_equals() in PHP 5.6
length()  : int
Multi-byte-safe string length calculation
substring()  : string
Multi-byte-safe substring calculation

Methods

constantTimeCompare()

Equivalent to hash_equals() in PHP 5.6

public static constantTimeCompare(string $knownString, string $userString) : bool
Parameters
$knownString : string
$userString : string
Return values
bool

length()

Multi-byte-safe string length calculation

public static length(string $str) : int
Parameters
$str : string
Return values
int

substring()

Multi-byte-safe substring calculation

public static substring(string $str[, int $start = 0 ][, int $length = null ]) : string
Parameters
$str : string
$start : int = 0
$length : int = null

(optional)

Return values
string

        
On this page

Search results