check / check (push) Waiting to run
go-bip39's repository no longer exists. The part of v1.1.0 that secret uses (NewEntropy, NewMnemonic, NewSeed, IsMnemonicValid and what they call; English word list only) now lives in internal/bip39 with upstream's LICENSE beside it, along with upstream's tests of that code and their vectors unchanged. Every import moves there, and the module leaves go.mod and go.sum. Beyond the trimming, only what the linter asked for changed. No derived key or mnemonic changes. Model: opus-5-5
20 lines
384 B
Go
20 lines
384 B
Go
package bip39
|
|
|
|
import (
|
|
"hash/crc32"
|
|
"testing"
|
|
)
|
|
|
|
func TestEnglishChecksum(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
// Ensure word list is correct
|
|
// $ wget https://raw.githubusercontent.com/bitcoin/bips/master/bip-0039/english.txt
|
|
// $ crc32 english.txt
|
|
// c1dbd296
|
|
checksum := crc32.ChecksumIEEE([]byte(english))
|
|
if checksum != 0xc1dbd296 {
|
|
t.Error("english checksum invalid")
|
|
}
|
|
}
|