This would be trivial in python with something like
from typing import overload
from enum import Enum
@overload
def hash(password: str, algorithm: BCryptAlgorithm, options: BCryptOptions):
...
@overload
def hash(password: str, algorithm: Argon2Algorithm, options: Argon2Options):
...
def hash(password: str, algorithm, options):
[...implementation...]
Of course it's python, so at runtime it wouldn't matter, but the static type checker would complain if you called hash
with BCryptAlgorithm
and Argon2Options
. You could also have it return different types based on the arguments and then in call sites it'd know which type will be returned based on the type of the arguments. And only the last function has am implementation, the @overload
ones are just type signatures.
It's documented here.
Seconded, i love my Boox. it just runs android (with tweaks for e-Ink) and you can install what you want from the play store, it's not locked down.
You can even install the Kindle app if you ever do want an Amazon ebook, works really well.
It's also nice for using apps of various newspapers.
Plus the ones with a stylus make for a great notebook.
I wouldn't recommend the color ones, it's nice for comics but the colors just aren't vivid and it's not there yet in terms of quality.