util.go
func encodeTargets(alg Algorithm, obj interface{}) (interface{}, interface{}, error) {
	// determine what to encode
	switch val := obj.(type) {
	case *Token:
		return val.Header, val.Payload, nil
	}

	objVal := reflect.ValueOf(obj)
	objKind := objVal.Kind()
	if objKind == reflect.Struct || (objKind == reflect.Ptr && objVal.Elem().Kind() == reflect.Struct) {
		return grabEncodeTargets(alg, obj)
	}

	return alg.Header(), obj, nil
}
func encodeTargets(alg Algorithm, obj interface{}) (interface{}, interface{}, error) {
	// determine what to encode
	switch val := obj.(type) {
	case *Token:
		return val.Header, val.Payload, nil
	}

	objVal := reflect.ValueOf(obj)
	objKind := objVal.Kind()
	if objKind == reflect.Struct || (objKind == reflect.Ptr && objVal.Elem().Kind() == reflect.Struct) {
		return grabEncodeTargets(alg, obj)
	}

	return alg.Header(), obj, nil
}
// encodeTargets determines what to encode.