I'm trying to setup the NanoSalt library on XAMPP with PHP 8.1
It return to me this error:
Fatal error: Uncaught Error: Class "MikeRow\Salt\Exception" not found in C:\xampp\htdocs\Peppe\vendor\mikerow\salt\src\NanoSalt.php:28 Stack trace: #0 C:\xampp\htdocs\Peppe\index.php(3): require_once() #1 {main} thrown in C:\xampp\htdocs\Peppe\vendor\mikerow\salt\src\NanoSalt.php on line 28
That's my index.php content:
<?php
use MikeRow\Salt\NanoSalt;
require_once "vendor/mikerow/salt/src/NanoSalt.php";
$nanoSalt = new NanoSalt();
$public_key = $nanoSalt->crypto_sign_public_from_secret_key(hex2bin("781186FB9EF17DB6E3D1056550D9FAE5D5BBADA6A6BC370E4CBB938B1DC71DA3"));
print(strtoupper($public_key->toHex()) . PHP_EOL);
?>
How can I resolve that?
vendor/autoload.phpfile.Fatal error: Uncaught Error: Class "MikeRow\Salt\Exception" not found in C:\xampp\htdocs\Peppe\vendor\mikerow\salt\src\NanoSalt.php:28 Stack trace: #0 C:\xampp\htdocs\Peppe\vendor\composer\ClassLoader.php(571): include() #1 C:\xampp\htdocs\Peppe\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile('C:\\xampp\\htdocs...') #2 C:\xampp\htdocs\Peppe\index.php(5): Composer\Autoload\ClassLoader->loadClass('MikeRow\\Salt\\Na...') #3 {main} thrown in C:\xampp\htdocs\Peppe\vendor\mikerow\salt\src\NanoSalt.php on line 28Exceptionclass on line 28 needs a leading "\", or you can bring it into scope with ausestatement. There might be other problems of a similar nature in there, too.Fatal error: Uncaught Error: Call to undefined method MikeRow\Salt\FieldElement::rewind() in C:\xampp\htdocs\Peppe\vendor\mikerow\salt\src\FieldElement.php:21 Stack trace: #0 C:\xampp\htdocs\Peppe\vendor\mikerow\salt\src\NanoSalt.php(300): MikeRow\Salt\FieldElement->toString() #1 C:\xampp\htdocs\Peppe\index.php(6): MikeRow\Salt\NanoSalt->crypto_sign_public_from_secret_key(Object(MikeRow\Salt\FieldElement)) #2 {main} thrown in C:\xampp\htdocs\Peppe\vendor\mikerow\salt\src\FieldElement.php on line 21