abstract class Openclerk\Currencies \ HashAlgorithm

All known direct subclasses:
SHA256,Scrypt

A "HashAlgorithm" represents some type of algorithm used to hash a cryptocurrency. The performance of the algorithm can be measured in some way, in operations per second.

This is the base interface; other interfaces will provide additional functionality as necessary.


Method Summary

Name Description
getCode() Get the unique 1-32 character algorithm code for this algorithm, e.g. 'sha256' or 'scrypt'. Must be lowercase. This is not visible to users.
getDivisor() For some currencies, hashrates are normally measured in kh/s (divisor = 1e3); for some currencies, hashrates are normally measured in MH/s (divisor = 1e6); for some currencies, hashrates are normally measured in GH/s (divisor = 1e9).
getDivisorText() Get the user-visible text for this divisor. By default, generates the text based on #getDivisor().
getName() Get the English name of this algorithm, e.g. "SHA-256" or "Scrypt".

abstract function getCode()

Get the unique 1-32 character algorithm code for this algorithm, e.g. 'sha256' or 'scrypt'. Must be lowercase. This is not visible to users.


public function getDivisor()

For some currencies, hashrates are normally measured in kh/s (divisor = 1e3); for some currencies, hashrates are normally measured in MH/s (divisor = 1e6); for some currencies, hashrates are normally measured in GH/s (divisor = 1e9).

Returns:
by default, 1e3

public function getDivisorText()

Get the user-visible text for this divisor. By default, generates the text based on #getDivisor().


abstract function getName()

Get the English name of this algorithm, e.g. "SHA-256" or "Scrypt".