keys/hd/address.go
func ReverseBytes(buf []byte) []byte {
	var res []byte
	if len(buf) == 0 {
		return res
	}

	// Walk till mid-way, swapping bytes from each end:
	// b[i] and b[len-i-1]
	blen := len(buf)
	res = make([]byte, blen)
	mid := blen / 2
	for left := 0; left <= mid; left++ {
		right := blen - left - 1
		res[left] = buf[right]
		res[right] = buf[left]
	}
	return res
}
func ReverseBytes(buf []byte) []byte {
	var res []byte
	if len(buf) == 0 {
		return res
	}

	// Walk till mid-way, swapping bytes from each end:
	// b[i] and b[len-i-1]
	blen := len(buf)
	res = make([]byte, blen)
	mid := blen / 2
	for left := 0; left <= mid; left++ {
		right := blen - left - 1
		res[left] = buf[right]
		res[right] = buf[left]
	}
	return res
}
func ReverseBytes ( buf [ ] byte ) [ ] byte { var res [ ] byte if len ( buf ) == 0 { return res } // Walk till mid-way, swapping bytes from each end: // b[i] and b[len-i-1] blen := len ( buf ) res = make ( [ ] byte , blen ) mid := blen / 2 for left := 0 ; left <= mid ; left ++ { right := blen - left - 1 res [ left ] = buf [ right ] res [ right ] = buf [ left ] } return res }
// ReverseBytes returns the buf in the opposite order
ReverseBytes returns the buf in the opposite order