HashUtils
in package
Contains hashing utilities
Table of Contents
Methods
- binToHex() : string
- Converts a hash in binary form to hex form
- hexToBin() : string
- Converts a hash in hex form to binary form
- validateAlgorithm() : bool
- Checks if the algorithm specified exists and throws an exception if it does not
Methods
binToHex()
Converts a hash in binary form to hex form
public
static binToHex(string $hash) : string
Parameters
- $hash : string
-
Hash in binary form
Return values
string —Hash in hex form
hexToBin()
Converts a hash in hex form to binary form
public
static hexToBin(string $hash) : string
Parameters
- $hash : string
-
Hash in hex form
Return values
string —Hash in binary form
validateAlgorithm()
Checks if the algorithm specified exists and throws an exception if it does not
public
static validateAlgorithm(string $algorithm) : bool
Parameters
- $algorithm : string
-
Name of the algorithm to validate