Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
This repository was archived by the owner on Apr 16, 2026. It is now read-only.

Slow for runtime usage #1

@ghost

Description

If we want to run the code at runtime, the brute force code like this should not be used:

while n != index:
            new_string = api_generate_sentence(
                result_str, cut=char_per_index, **api_args
            )
            hash = hashlib.sha256(new_string.encode(encoding="utf-8")).hexdigest()
            hash_int = int(hash, 16)
            n = hash_int % base

because the loop is like the "proof of work" mechanism in crypto mining which takes a lot of time (and power).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions