refactor: susun semula struktur folder — Laravel source ke src/

This commit is contained in:
Saufi
2026-05-19 15:58:35 +08:00
parent f052251b94
commit bf53c71b45
10806 changed files with 1385379 additions and 121 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace Safe;
use Safe\Exceptions\HashException;
/**
* @param string $algo
* @param string $key
* @param int $length
* @param string $info
* @param string $salt
* @return false|non-falsy-string
*
*/
function hash_hkdf(string $algo, string $key, int $length = 0, string $info = "", string $salt = "")
{
error_clear_last();
$safeResult = \hash_hkdf($algo, $key, $length, $info, $salt);
return $safeResult;
}
/**
* @param \HashContext $context
* @param string $filename
* @param \HashContext|null $stream_context
* @throws HashException
*
*/
function hash_update_file(\HashContext $context, string $filename, ?\HashContext $stream_context = null): void
{
error_clear_last();
if ($stream_context !== null) {
$safeResult = \hash_update_file($context, $filename, $stream_context);
} else {
$safeResult = \hash_update_file($context, $filename);
}
if ($safeResult === false) {
throw HashException::createFromPhpError();
}
}