private static function build($input, $password, $cost, $salt = null)
{
// Generate salt if needed
$salt = $salt === null ? Random::bytes(16) : $salt;
// Verify and normalize cost value
$cost = self::cost($cost);
// Create key to use for hmac operations
$key = \hash_hmac(self::ALGO, $salt, $password, true);
// Perform hash iterations. Get a 32 byte output value
$hash = self::ihmac($input, $key, $cost, self::ALGO);
// Return the salt + cost blob + hmac
return $salt . self::costHash($cost, $salt, $password) . $hash;
}