Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gen12(words) function #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Commits on Dec 4, 2023

  1. Update gen12(words) function

    /**
     * This function generates a 12-word mnemonic phrase from a given list of words.
     * It is designed to be efficient and quick in selecting words for the phrase.
     *
     * How it works:
     * - It randomly selects 12 words from the provided list without repeating any word.
     * - The selection is done by generating random indices for the array of words,
     *   ensuring that each word in the phrase is unique and randomly chosen.
     * 
     * Why it's good:
     * - Efficiency: Unlike methods that require shuffling the entire list of words 
     *   each time a new word is needed, this function simply picks a random word 
     *   from the list, which is computationally less expensive.
     * - Simplicity: The logic is straightforward and easy to understand, making 
     *   the function maintainable and modifiable.
     * - Flexibility: It can easily be adapted to generate phrases of different lengths 
     *   or from different word lists by adjusting the parameters.
     */
    Alexcs24 authored Dec 4, 2023
    Configuration menu
    Copy the full SHA
    f57c6f8 View commit details
    Browse the repository at this point in the history