1package common 2 3// SwapEndianness swaps the order of the bytes in the slice. 4func SwapEndianness(b []byte) []byte { 5 o := make([]byte, len(b)) 6 for i := range b { 7 o[len(b)-1-i] = b[i] 8 } 9 return o 10}