How to generate a valid hash for a bip39 seed phrase? I'm trying to prove to myself that I understand how bip39 seed phrases work...  I'm doing most of this in a spreadsheet because I thought it would be easier but I'm having trouble with the checksum value...  These are the steps I'm taking:


I start with a valid 24 word seed 
then change each word to its index value
then change those to a single 264 binary digit string
then change that to a 66 character hexadecimal string
I manually enter the first 64 hexadecimal characters into a
binary editor to create a 32 byte file
then I use the linux terminal command 'shasum -a 256' on that 32 byte file to get the hash


However, the leading byte of that hash does not match the last byte of the 66 character hexadecimal string from above...

As I understand it, 24 word bip39 seed phrases have a single byte checksum value at the end.  That checksum is the first byte of a sha256 hash of the first 32 bytes of the number encoded by the seed phrase.  But, so far, I haven't been able to supply a 33rd byte that reproduces a valid seed phrase...  Any suggestions?
You can create a valid seed calculating a valid last word (23+1).

Even using the browser JS console:

mywords="sausage liquid same heart ... "

allwords = WORDLISTS["english"]
m = new Mnemonic("english")
for (var w in allwords) { 
       curr_word=allwords[w]; 
       test_words = mywords + " " + curr_word; 
       if (m.check(test_words)) { console.log(curr_word) } 
 }


Source: 

http://wikistas.com/u/cryptodog!Ccsi1HdXWr/Wd5q-generating-secure-bip39-seeds