\PrivateBinFilter

Filter

Provides data filtering functions.

Summary

Methods
Properties
Constants
formatHumanReadableTime()
formatHumanReadableSize()
slowEquals()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

formatHumanReadableTime()

formatHumanReadableTime(string  $time) : string

format a given time string into a human readable label (localized)

accepts times in the format "[integer][time unit]"

Parameters

string $time

Throws

\Exception

Returns

string

formatHumanReadableSize()

formatHumanReadableSize(integer  $size) : string

format a given number of bytes in IEC 80000-13:2008 notation (localized)

Parameters

integer $size

Returns

string

slowEquals()

slowEquals(string  $a, string  $b) : boolean

fixed time string comparison operation to prevent timing attacks https://crackstation.net/hashing-security.htm?=rd#slowequals

Parameters

string $a
string $b

Returns

boolean