func AdcCertFingerprint(cert *x509.Certificate) string {
	h := sha256.New()
	h.Write(cert.Raw)
	return "SHA256/" + dcBase32Encode(h.Sum(nil))
}
AdcCertFingerprint returns the fingerprint of a certificate.
package protoadc
import (
	"bytes"
	"crypto/sha256"
	"crypto/x509"
	"encoding/base32"
	"fmt"
	"math/rand"
	"net"
	"reflect"
	"strings"
	"github.com/aler9/go-dc/adc"
	"github.com/aler9/dctk/pkg/log"
	"github.com/aler9/dctk/pkg/protocommon"
)
const (
	AdcCodeProtocolUnsupported = 41
	AdcCodeFileNotAvailable    = 51
	AdcCodeSlotsFull           = 53
)
func dcBase32Encode(in []byte) string {
	return strings.TrimRight(base32.StdEncoding.EncodeToString(in), "=")
}
func AdcRandomToken() string {
	const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	buf := make([]byte, 10)
	for i := range buf {
		buf[i] = chars[rand.Intn(len(chars))]
	}
	return string(buf)
}