// HexToBase64 converts a slice of hexadecimal bytes to the equivalent base64 slice of bytes.
HexToBase64 converts a slice of hexadecimal bytes to the equivalent base64 slice of bytes.
// HexToBase64 converts a slice of hexadecimal bytes to the equivalent base64 slice of bytes .
func HexToBase64(hexbytes []byte) ([]byte, error) {
	bytes := make([]byte, hex.DecodedLen(len(hexbytes)))
	_, err := hex.Decode(bytes, hexbytes)
	if err != nil {
		return nil, err
	}
	base64bytes := make([]byte, base64.StdEncoding.EncodedLen(len(bytes)))
	base64.StdEncoding.Encode(base64bytes, bytes)
	return base64bytes, nil
}
func HexToBase64 ( hexbytes [ ] byte ) ( [ ] byte , error ) { bytes := make ( [ ] byte , hex . DecodedLen ( len ( hexbytes ) ) ) _ , err := hex . Decode ( bytes , hexbytes ) if err != nil { return nil , err } base64bytes := make ( [ ] byte , base64 . StdEncoding . EncodedLen ( len ( bytes ) ) ) base64 . StdEncoding . Encode ( base64bytes , bytes ) return base64bytes , nil }
HexToBase64 converts a slice of hexadecimal bytes to the equivalent base64 slice of bytes.
HexToBase64 converts a slice of hexadecimal bytes to the equivalent base64 slice of bytes .