There are many scripting languages that do not have unsinged int, such as PHP. Generally speaking, there is no difference between bit operations between int and unsinged int. Except for the right shift operation, int is filled with 1 and unsinged int is filled with 0. I thought about it for a long time and finally thought of a better method. However, this method , the number of right shifts is at least greater than 1. Generally speaking, shifting right by 0 has little meaning.
(($a >> 1) & 0x7fffffff) >> ($n -1) Here $n is the number of right shifts. $n >= 1
For example, to implement md5 encryption, generally the following function is used, which can be implemented in PHP like this:
Those who are more interested in encryption and decryption may have encountered the same problem as me. I wonder if anyone has a better method.