更新文件

This commit is contained in:
技术老胡 2024-12-16 14:15:27 +08:00
parent f62d4cd103
commit e9f64988a9
2 changed files with 0 additions and 23 deletions

View File

@ -1,9 +0,0 @@
<?php
header('content-type: application/json; charset=utf-8');
$path = '../runtime/order.json';
if (!file_exists($path)) {
exit('{"code":3,"msg":"文件不存在"}');
} else {
exit(file_get_contents($path));
}

View File

@ -1,14 +0,0 @@
<?php
function encrypt($string, $key) {
$method = "AES-256-CBC";
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($method));
$encrypted = openssl_encrypt($string, $method, $key, 0, $iv);
// 将iv和加密字符串拼接起来
return base64_encode($iv . $encrypted);
}
$key = "your-encryption-key"; // 这里应该是一个安全的密钥
$string = "Hello, World!";
$encryptedString = encrypt($string, $key);
echo $encryptedString; // 输出加密字符串