仓库初始化

This commit is contained in:
2025-08-13 10:43:56 +08:00
commit e8f9b46680
5180 changed files with 859303 additions and 0 deletions

31
extend/Yzh/Utils/Hmac.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
namespace Yzh\Utils;
class Hmac
{
protected $mode = "sha256";
protected $app_key;
/**
* @param string $appKey
*/
public function __construct($appKey)
{
$this->app_key = $appKey;
}
/**
* @param string $data
* @param string $key
*/
public function sign($data): string
{
return hash_hmac($this->mode, $data, $this->app_key);
}
public function verify($data, $sign)
{
return $this->sign($data) == $sign;
}
}