codekingpro/portable-devtools
115k
1# SPDX-License-Identifier: MIT2 3from __future__ import annotations4 5 6class Argon2Error(Exception):7 """8 Superclass of all argon2 exceptions.9 10 Never thrown directly.11 """12 13 14class VerificationError(Argon2Error):15 """16 Verification failed.17 18 You can find the original error message from Argon2 in ``args[0]``.19 """20 21 22class VerifyMismatchError(VerificationError):23 """24 The secret does not match the hash.25 26 Subclass of :exc:`argon2.exceptions.VerificationError`.27 28 .. versionadded:: 16.1.029 """30 31 32class HashingError(Argon2Error):33 """34 Raised if hashing failed.35 36 You can find the original error message from Argon2 in ``args[0]``.37 """38 39 40class InvalidHashError(ValueError):41 """42 Raised if the hash is invalid before passing it to Argon2.43 44 .. versionadded:: 23.1.045 As a replacement for :exc:`argon2.exceptions.InvalidHash`.46 """47 48 49class UnsupportedParametersError(ValueError):50 """51 Raised if the current platform does not support the parameters.52 53 For example, in WebAssembly parallelism must be set to 1.54 55 .. versionadded:: 25.1.056 """57 58 59InvalidHash = InvalidHashError60"""61Deprecated alias for :class:`InvalidHashError`.62 63.. versionadded:: 18.2.064.. deprecated:: 23.1.065 Use :exc:`argon2.exceptions.InvalidHashError` instead.66"""67 