I use this little code in a function to generate immutable hash of strings and store it.
My problem is i don’t know how to find the max possible value with sha256 :7 ‘little’ ???
Well, if you have seven bytes, and you turn that into an integer, the maximum value is the same as the maximum value of a (7*8) bit integer, because there are 8 bits in a byte. The largest value of a 56-bit unsigned integer is 2**56 – 1, and the smallest value is 0.
>>> 2**56 - 1 72057594037927935
What about negative values? int.from_bytes() interprets its value as unsigned by default, so you won’t have negative values.