package lattice // MakeCodeKey encodes a stage in the high 8 bits and a 56-bit hash below it. // The parameter order is (stage, hash). iskra/stage.mx MakeCodeKey. func MakeCodeKey(stage uint8, hash uint64) Key { return Key(uint64(stage)<<56 | hash&0x00FFFFFFFFFFFFFF) } // KeyStage extracts the stage byte from a key. func KeyStage(key Key) uint8 { return uint8(key >> 56) } // KeyHash extracts the 56-bit hash from a key. func KeyHash(key Key) uint64 { return uint64(key) & 0x00FFFFFFFFFFFFFF }