Private/Wordlist/Get-SecretSharingWordIndexMap.ps1

function Get-SecretSharingWordIndexMap {
    <#
    .SYNOPSIS
        Returns a lowercase-word -> 10-bit-index lookup table for the SLIP-0039 wordlist.
    #>

    [CmdletBinding()]
    [OutputType([hashtable])]
    param()

    if ($script:SecretSharingWordIndexMap) {
        return $script:SecretSharingWordIndexMap
    }

    $wordlist = Get-SecretSharingWordlist
    $map = @{}
    for ($i = 0; $i -lt $wordlist.Count; $i++) {
        $map[$wordlist[$i]] = $i
    }

    $script:SecretSharingWordIndexMap = $map
    return $script:SecretSharingWordIndexMap
}