class Hash (View source)

The GenericDatabase\Helpers\Hash class provides a method to generate a hash using a specified algorithm.

Method:

  • hash(string $type = 'sha512', int $length = 64): object: Generates a hash using the specified algorithm and length

Methods

static string
hash(string $type = 'sha512', int $length = 64)

Generates a hash using the specified algorithm and length.

Details

static string hash(string $type = 'sha512', int $length = 64)

Generates a hash using the specified algorithm and length.

Parameters

string $type

The hash algorithm to use (default is 'sha512').

int $length

The length of the random bytes to generate (default is 64).

Return Value

string

The generated hash.

Exceptions

RandomException