Files
admin_hura_8/inc/Hura8/System/Security/Hash.php
2024-01-29 10:39:53 +07:00

19 lines
411 B
PHP

<?php
namespace Hura8\System\Security;
class Hash
{
protected const CHECK_SUM_KEY = "as21321ASDAS"; // can change this key per project
public static function createCheckSum($txt) : string {
return hash_hmac('sha256', $txt, static::CHECK_SUM_KEY);
}
public static function verifyCheckSum($checksum, $txt) : bool {
return ($checksum == static::createCheckSum($txt));
}
}