class Identifier (View source)

A helper that allows the creation of unique strings, for use when creating hashes, identifiers.

\@package Helpers

Methods

generateFromBase($string, $table, $key)

Like generate() below, but simply appends an ever increasing number to what you provide until it comes back as not found.

string
generate(string $table, string $key, int $length = 12, bool $lowercase = false)

Generates a unique identifier for an item in a database table. Used, among other places, in generating User hashes for email validation.

string
getString(int $length = 12)

Generate a cryptographically secure random string

deleteKey($table, $keyCol, $uHash)

No description

Details

generateFromBase($string, $table, $key)

Like generate() below, but simply appends an ever increasing number to what you provide until it comes back as not found.

Parameters

$string
$table
$key

string generate(string $table, string $key, int $length = 12, bool $lowercase = false)

Generates a unique identifier for an item in a database table. Used, among other places, in generating User hashes for email validation.

Parameters

string $table
string $key
int $length
bool $lowercase

Return Value

string

string getString(int $length = 12)

Generate a cryptographically secure random string

Parameters

int $length

Return Value

string

deleteKey($table, $keyCol, $uHash)

No description

Parameters

$table
$keyCol
$uHash