Rust

Auth

Partly Rust
The password hash algorithms of utopia-php/auth: PECL scrypt, Firebase's modified scrypt and phpass.

In Appwrite#

Appwrite runs some of its classes from the Rust crate; the rest are still PHP.

9 PHP classes served from Rust39 still PHP
Rust 8,655 lines (6,071 code)· PHP 3,287 lines (1,784 code)split
PartCodeCommentsBlankTotalFiles
Rust source6,0711,8837018,65542
PHP source1,7849545493,28739

Comments include doc comments. Each side counts its src/; the PHP side is what the package still has in PHP.

Served from Rust (9)
Utopia\Auth\HashUtopia\Auth\Hashes\Argon2Utopia\Auth\Hashes\BcryptUtopia\Auth\Hashes\MD5Utopia\Auth\Hashes\PHPassUtopia\Auth\Hashes\PlaintextUtopia\Auth\Hashes\ScryptUtopia\Auth\Hashes\ScryptModifiedUtopia\Auth\Hashes\Sha
Still PHP (39)
Utopia\Auth\Enums\AuthorizationDetailUtopia\Auth\Enums\ClaimUtopia\Auth\Enums\HeaderUtopia\Auth\Enums\PromptUtopia\Auth\IssuerUtopia\Auth\Issuers\AsymmetricUtopia\Auth\Issuers\Asymmetric\AccessTokenUtopia\Auth\Issuers\Asymmetric\IdTokenUtopia\Auth\Issuers\SymmetricUtopia\Auth\Issuers\Symmetric\JwtUtopia\Auth\Issuers\Symmetric\RefreshTokenUtopia\Auth\OAuth2\AuthorizationDetailsUtopia\Auth\OAuth2\ClientIdMetadataDocumentUtopia\Auth\OAuth2\ClientIdentifierUrlUtopia\Auth\OAuth2\InvalidClientMetadataExceptionUtopia\Auth\OAuth2\InvalidPromptExceptionUtopia\Auth\OAuth2\InvalidRequestUriExceptionUtopia\Auth\OAuth2\InvalidResourceExceptionUtopia\Auth\OAuth2\PARUtopia\Auth\OAuth2\PromptsUtopia\Auth\OAuth2\RedirectUrisUtopia\Auth\OAuth2\ResourceIndicatorsUtopia\Auth\Passkeys\CeremonyUtopia\Auth\Passkeys\ChallengeUtopia\Auth\Passkeys\CounterUtopia\Auth\Passkeys\CredentialUtopia\Auth\Passkeys\ExceptionUtopia\Auth\Passkeys\OriginUtopia\Auth\Passkeys\RelyingPartyUtopia\Auth\ProofUtopia\Auth\Proofs\CodeUtopia\Auth\Proofs\PasswordUtopia\Auth\Proofs\PhraseUtopia\Auth\Proofs\TokenUtopia\Auth\StoreUtopia\Auth\VerifierUtopia\Auth\Verifiers\AsymmetricUtopia\Auth\Verifiers\SymmetricUtopia\Auth\Verifiers\VerificationException

Install#

Shell
cargo add utopia-auth

Overview#

The password hash algorithms of utopia-php/auth (Utopia\Auth\Hashes) that PHP itself does not provide: the scrypt KDF of the PECL scrypt extension, Firebase's modified scrypt, and phpass's portable hashes. The rest (password_hash(), password_verify(), crypt(), hash()) are PHP's own functions, ported in php-std.

Every function here returns what PHP returns for the same input, byte for byte, including where PHP fails: scrypt::scrypt fails as scrypt() does, with its Errors, its warnings and its false.

Modules#

Each module groups one concept of the library. Internal ones hold items the crate re-exports at its root.

API#

What utopia_auth exports at its root.