This reminds me of Zobrist hashing [1] in chess engines. In fact, if you split the sum into 256 columns (instead of 8) and set the prime to 2 for each column, I think it's essentially the same. I'd be curious to see some quantitative benchmarks and their results on performance + collision rates.
[1]: https://www.chessprogramming.org/Zobrist_Hashing