bd3f5923fa
01d4638687
1af8ad3a2b
51b45ba53b
89b8be5147
This commit is contained in:
FbIN Support 2026-08-21 11:57:23 +05:30
commit ea755600ad
2 changed files with 3425 additions and 1275 deletions

View file

@ -45,15 +45,15 @@ class anubis{
if(
!isset($script["challenge"]) ||
!is_string($script["challenge"]["randomData"]) ||
!isset($script["rules"]["difficulty"]) ||
!is_int($script["rules"]["difficulty"]) ||
!is_string($script["challenge"])
!is_int($script["rules"]["difficulty"])
){
throw new Exception("Found invalid challenge data");
}
return $this->rape($script["challenge"], $script["rules"]["difficulty"]);
return $this->rape($script["challenge"]["id"], $script["challenge"]["randomData"], $script["rules"]["difficulty"]);
}
private function is_valid_hash($hash, $difficulty){
@ -74,9 +74,10 @@ class anubis{
return true;
}
public function rape($data, $difficulty = 5){
public function rape($id, $data, $difficulty = 5){
$nonce = 0;
$microtime = microtime(true);
while(true){
@ -87,10 +88,12 @@ class anubis{
$hash_hex = bin2hex($hash_binary);
return [
"id" => $id,
"response" => $hash_hex,
//"data" => $data,
//"difficulty" => $difficulty,
"nonce" => $nonce
"nonce" => $nonce,
"elapsedTime" => round((microtime(true) - $microtime) * 1000)
];
}

View file

@ -644,7 +644,6 @@ class frontend{
"google_cse" => "Google CSE",
"yahoo_japan" => "Yahoo! JAPAN",
"startpage" => "Startpage",
"qwant" => "Qwant",
"yep" => "Yep",
"mwmbl" => "Mwmbl",
"mojeek" => "Mojeek",
@ -671,7 +670,6 @@ class frontend{
"google_cse" => "Google CSE",
"yahoo_japan" => "Yahoo! JAPAN",
"startpage" => "Startpage",
"qwant" => "Qwant",
"naver" => "Naver",
"baidu" => "Baidu",
"solofield" => "Solofield",
@ -705,7 +703,6 @@ class frontend{
"google" => "Google",
"yahoo_japan" => "Yahoo! JAPAN",
"startpage" => "Startpage",
"qwant" => "Qwant",
"naver" => "Naver",
"baidu" => "Baidu",
"coccoc" => "Cốc Cốc",
@ -724,7 +721,6 @@ class frontend{
"google" => "Google",
"yahoo_japan" => "Yahoo! JAPAN",
"startpage" => "Startpage",
"qwant" => "Qwant",
//"mojeek" => "Mojeek",
"baidu" => "Baidu"
]