Go language provides inbuilt support for bits to implement bit counting and manipulation functions for the predeclared unsigned integer types with the help of bits package. This package provides ReverseBytes() function which is used to find the reversed order of the value of a. To access ReverseBytes() function you need to add a math/bits package in your program with the help of the import keyword.
func ReverseBytes(a uint) uint
Parameters: This function takes one parameter of uint type, i.e., a.
Return Value: This function returns the value of a with its bits in reversed order.
Reverse order of 7: 11100000000000000000000000000000000000000000000000000000000
ReverseBytes(11) := 1100000000000000000000000000000000000000000000000000000000 ReverseBytes(111) := 11100000000000000000000000000000000000000000000000000000000