cryptal  latest
Cryptography Abstraction Layer
fpoirotte\Cryptal\Implementers\HashInterface Interface Reference
+ Inheritance diagram for fpoirotte\Cryptal\Implementers\HashInterface:

Public Member Functions

 __construct (HashEnum $algorithm)
 
- Public Member Functions inherited from fpoirotte\Cryptal\ContextBasedInterface
 __toString ()
 
 finalize ($raw=false)
 
 update ($data)
 

Static Public Member Functions

static hash (HashEnum $algorithm, $data, $raw=false)
 

Detailed Description

Definition at line 9 of file HashInterface.php.

Constructor & Destructor Documentation

fpoirotte\Cryptal\Implementers\HashInterface::__construct ( HashEnum  $algorithm)

Construct a new hashing context.

Parameters
HashEnum$algorithmAlgorithm to use to produce the hash/message digest.

Implemented in fpoirotte\Cryptal\DefaultAlgorithms\Hash.

Member Function Documentation

static fpoirotte\Cryptal\Implementers\HashInterface::hash ( HashEnum  $algorithm,
  $data,
  $raw = false 
)
static

All-in-one function to quickly compute the hash/message digest for a string of text.

Parameters
HashEnum$algorithmAlgorithm to use to produce the hash/message digest.
string$dataData to hash.
bool$raw(optional) Whether the result should be returned in raw form (true) or using its hexadecimal representation (false). Defaults to false.
Return values
stringHash/message digest for the given data.

Implemented in fpoirotte\Cryptal\Implementers\AbstractHash.


The documentation for this interface was generated from the following file: