class Hash extends StringMutator (View source)

Generates a hash of the input string with the given algorithm.

Traits

Methods

__construct(string $algorithm, bool $rawOutput = false)

No description

mixed
__invoke(mixed $value)

Mutate the input value.

from  Mutator
static Hash
crc32(bool $rawOutput = false)

No description

static Hash
make(string $algorithm, bool $rawOutput = false)

No description

static Hash
md5(bool $rawOutput = false)

No description

mixed
mutate(mixed $value)

Mutate the input value.

string
mutateString(string $value)

No description

string
resolveStringInput(mixed $value)

No description

static Hash
sha1(bool $rawOutput = false)

No description

static Hash
sha256(bool $rawOutput = false)

No description

static Hash
sha512(bool $rawOutput = false)

No description

Details

__construct(string $algorithm, bool $rawOutput = false)

No description

Parameters

string $algorithm

The algorithm to use.

bool $rawOutput

Whether to output raw binary data (default: false).

final mixed __invoke(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed

static Hash crc32(bool $rawOutput = false)

No description

Parameters

bool $rawOutput

Whether to output raw binary data (default: false).

Return Value

Hash

static Hash make(string $algorithm, bool $rawOutput = false)

No description

Parameters

string $algorithm

The algorithm to use.

bool $rawOutput

Whether to output raw binary data (default: false).

Return Value

Hash

static Hash md5(bool $rawOutput = false)

No description

Parameters

bool $rawOutput

Whether to output raw binary data (default: false).

Return Value

Hash

final mixed mutate(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed

protected string mutateString(string $value)

No description

Parameters

string $value

Return Value

string

protected string resolveStringInput(mixed $value)

No description

Parameters

mixed $value

Return Value

string

static Hash sha1(bool $rawOutput = false)

No description

Parameters

bool $rawOutput

Whether to output raw binary data (default: false).

Return Value

Hash

static Hash sha256(bool $rawOutput = false)

No description

Parameters

bool $rawOutput

Whether to output raw binary data (default: false).

Return Value

Hash

static Hash sha512(bool $rawOutput = false)

No description

Parameters

bool $rawOutput

Whether to output raw binary data (default: false).

Return Value

Hash