<?php
$file = 'privatekey.txt';
$handle = fopen($file, 'w');
for ($v1 = 78457163725914333419136; $v1 <= 78457163725914333419136+10; $v1++) {
$randomWord = $v1;
$hash = hash('sha256', $randomWord);
$data = $hash . "\r\n";
fwrite($handle, $data);
}
fclose($handle); // Close the file handle
echo "Created";
?>
这是一个无限循环。有没有不使用类直接解决的方法?
<?php
$file = 'privatekey.txt';
$handle = fopen($file, 'w');
$start = '78457163725914333419136';
$end = '78457163725914334419146'; // 10 more than start
for ($v1 = $start; bccomp($v1, $end) <= 0; $v1 = bcadd($v1, '1')) {
$hash = hash('sha256', $v1);
$data = $hash . "\r\n";
fwrite($handle, $data);
}
fclose($handle); // Close the file handle
echo "Created";
?>