public function mnemonicToEntropy($mnenomic)
    {
        $bitstring = $this->parseMnemonic($mnenomic);

        // Calculate expected lengths
        $numChecksumBits = strlen($bitstring) / 33;
        $numEntropyBits = strlen($bitstring) - $numChecksumBits;

        // Get checksum bits from the end of the string
        $checksumBits = substr($bitstring, -1 * $numChecksumBits);
        $checksumHex = static::bitstringToHex($checksumBits);

        // Remaining bits are the entropy
        $entropyBits = substr($bitstring, 0, $numEntropyBits);
        $entropyHex = static::bitstringToHex($entropyBits);

        $entropyBytes = hex2bin($entropyHex);

        if ($checksumHex !== static::getEntropyChecksumHex($entropyBytes)) {
            throw new \InvalidArgumentException('Invalid checksum');
        }

        return $entropyBytes;
    }