How to reverse bits in a 32 bit number:
delete previous attempt using bit manipulation.
convert to binary. Convert to string. Use string reverse function from stdlib.
Do you have delusions about where you work? Does this look like Amazon? This is an underfunded bureacracy. Write code that will never break. This function runs about six times per month when the department secretary does that transaction. The milliseconds you saved are the hours of scarce expensive labor you wasted when the maintenance developer breaks it.
♡ 0 ↻ 0