This commit is contained in:
2024-01-29 10:39:53 +07:00
parent 545c404fdf
commit 72170f373a
143 changed files with 20188 additions and 3 deletions

View File

@@ -0,0 +1,18 @@
<?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));
}
}