This article mainly introduced in PHP to convert signed integer to unsigned integer method, the conversion method is very simple, this article directly gives the conversion method, the need for friends can refer to the
In a short address project, the ID of the short address map of the six-bit character becomes a signed integer when the ID exceeds 2147483647, according to the mapping algorithm between the six-bit character and the ID.
The code is as follows:
ID > Six-bit character > Mapping ID
id:2147483644 > Tfffvq > 2147483644
id:2147483645 > Efffvq > 2147483645
id:2147483646 > Nfffvq > 2147483646
id:2147483647 > Ffffvq > 2147483647
id:2147483648 > Nnnnnu >-2147483648
id:2147483649 > Dnnnnu >-2147483647
id:2147483650 > Rnnnnu >-2147483646
You need to convert a signed integer to an unsigned integral type: (float) sprintf ('%u ', $id)