Danger
Nothing here should be used for any security purposes.
Types¶
Imported with:
import toy_crypto.types
Helpful(?) type declarations and guards.
These are intended to make things easier for me, the author (jpgoldberg). They are not carefully thought out. This module is probably the least stable of any of these unstable modules.
- class toy_crypto.types.Bit(b: SupportsBool)¶
Because I made poor choices earlier of how to represent bits, I need an abstraction.
- Parameters:
b (SupportsBool)
- toy_crypto.types.Byte¶
And int representing a single byte.
Currently implemented as a type alias. As a consequence, type checking is not going to identify cases where an int out of the range of a byte is used.
- class toy_crypto.types.SupportsBool(*args, **kwargs)¶
- toy_crypto.types.is_positive_int(val: Any) TypeGuard[PositiveInt] ¶
true if val is a float, s.t. 0.0 <= val <= 1.0
- Parameters:
val (Any)
- Return type: