wfexs_backend.utils.passphrase_wrapper#

Module Contents#

Classes#

API#

class wfexs_backend.utils.passphrase_wrapper.RemoteWordlistResource#

Bases: typing.NamedTuple

uri: str = None#
substart: int = 0#
subend: int | None = None#
class wfexs_backend.utils.passphrase_wrapper.WfExSPassphraseGenerator(cacheHandler: wfexs_backend.cache_handler.SchemeHandlerCacheHandler, cacheDir: pathlib.Path | None = None, word_sets: Mapping[str, Sequence[RemoteWordlistResource]] = DEFAULT_WORD_SETS)#

Initialization

DEFAULT_PASSPHRASE_LENGTH: Final[int] = 6#
WFEXS_PASSPHRASE_SCHEME: Final[str] = 'wfexs.funny-passphrase'#
DEFAULT_WORD_SETS: Mapping[str, Sequence[RemoteWordlistResource]] = None#
MIN_RAND_CHARS: Final[int] = 5#
MAX_RAND_CHARS: Final[int] = 13#
property fungen: funny_passphrase.generator.FunnyPassphraseGenerator#
property initialized: bool#
initialize() bool#
_materialize_word_sets(raw_word_sets: Mapping[str, Sequence[RemoteWordlistResource]]) Mapping[str, CompressedIndexedText]#

Download and index each one of the components of the word sets

generate_passphrase_random(chosen_wordlist: str | int | Sequence[str | int] | None = None, passphrase_length: int = DEFAULT_PASSPHRASE_LENGTH) str#

This method is needed to hook into the funny passphrase library

generate_nickname() str#

This method generates random nicknames using two specific wordlists (if available)

class wfexs_backend.utils.passphrase_wrapper.WfExSPassGenSingleton#

Bases: wfexs_backend.utils.passphrase_wrapper.WfExSPassphraseGenerator

Initialization

__instance: ClassVar[WfExSPassphraseGenerator | None] = None#
__new__() wfexs_backend.utils.passphrase_wrapper.WfExSPassphraseGenerator#