func UInt64(r interface{}, err error) (uint64, error) {
	if err != nil {
		return 0, err
	}
	switch r := r.(type) {
	case uint64:
		return r, err
	case int:
		if r < 0 {
			return 0, simplesessions.ErrAssertType
		}
		return uint64(r), nil
	case int64:
		if r < 0 {
			return 0, simplesessions.ErrAssertType
		}
		return uint64(r), nil
	case []byte:
		n, err := strconv.ParseUint(string(r), 10, 64)
		return n, err
	case string:
		n, err := strconv.ParseUint(r, 10, 64)
		return n, err
	case nil:
		return 0, simplesessions.ErrNil
	}
	return 0, simplesessions.ErrAssertType
}
UInt64 converts interface to UInt64.
package conv
import (
	"strconv"
	"github.com/vividvilla/simplesessions"
)
func Int(r interface{}, err error) (int, error) {
	if err != nil {
		return 0, err
	}
	switch r := r.(type) {
	case int:
		return r, nil
	case int64:
		x := int(r)
		if int64(x) != r {
			return 0, strconv.ErrRange
		}
		return x, nil
	case []byte:
		n, err := strconv.ParseInt(string(r), 10, 0)
		return int(n), err
	case string:
		n, err := strconv.ParseInt(r, 10, 0)
		return int(n), err
	case nil:
		return 0, simplesessions.ErrNil
	}
	return 0, simplesessions.ErrAssertType
}
func Int64(r interface{}, err error) (int64, error) {
	if err != nil {
		return 0, err
	}
	switch r := r.(type) {
	case int:
		return int64(r), nil
	case int64:
		return r, nil
	case []byte:
		n, err := strconv.ParseInt(string(r), 10, 64)
		return n, err
	case string:
		n, err := strconv.ParseInt(r, 10, 64)
		return n, err
	case nil:
		return 0, simplesessions.ErrNil
	}
	return 0, simplesessions.ErrAssertType
}