// DecodeToInt64 decodes a base62 encoded string
342808
func (e *Encoding) DecodeToInt64(s string) int64 {
	var (
		n     int64
		c     int64
		idx   int
		power int
	)

	for i, v := range s {
		idx = strings.IndexRune(e.encode, v)

		// Work downwards through powers of our base
		power = len(s) - (i + 1)

		// Calculate value at this position and add
		c = int64(idx) * int64(math.Pow(float64(base), float64(power)))
		n = n + c
	}

	return int64(n)
}
652935
func (c *Context) GetInt64(key string) (i64 int64) {
	if val, ok := c.Get(key); ok && val != nil {
		i64, _ = val.(int64)
	}
	return
}
273399
func encodeBase64(s string) string {
	const lineLen = 70
	encLen := base64.StdEncoding.EncodedLen(len(s))
	lines := encLen/lineLen + 1
	buf := make([]byte, encLen*2+lines)
	in := buf[0:encLen]
	out := buf[encLen:]
	base64.StdEncoding.Encode(in, []byte(s))
	k := 0
	for i := 0; i < len(in); i += lineLen {
		j := i + lineLen
		if j > len(in) {
			j = len(in)
		}
		k += copy(out[k:], in[i:j])
		if lines > 1 {
			out[k] = '\n'
			k++
		}
	}
	return string(out[:k])
}
815241
func (dec *Decoder) DecodeSQLNullInt64(v *sql.NullInt64) error {
	if dec.isPooled == 1 {
		panic(InvalidUsagePooledDecoderError("Invalid usage of pooled decoder"))
	}
	return dec.decodeSQLNullInt64(v)
}
412925
func DecodeIntDesc(b []byte) ([]byte, int64, error) {
	if len(b) < 8 {
		return nil, 0, errors.New("insufficient bytes to decode value")
	}

	u := binary.BigEndian.Uint64(b[:8])
	v := decodeCmpUintToInt(^u)
	b = b[8:]
	return b, v, nil
}
22829
func (c *Config) GetInt64(key string) (i int64) {
	i64, _ := c.GetInt64Ok(key)
	return i64
}
579543
func (t *TxStructure) GetInt64(key []byte) (int64, error) {
	v, err := t.Get(key)
	if err != nil || v == nil {
		return 0, errors.Trace(err)
	}

	n, err := strconv.ParseInt(string(v), 10, 64)
	return n, errors.Trace(err)
}
27483
func Int64ToBytes(v int64) []byte {
	ret := make([]byte, 8)
	Int64ToBytesTo(v, ret)
	return ret
}
475807
func TryToInt64(i interface{}) (r int64, err error) {
	switch t := i.(type) {
	case nil:
		r = 0
	case int:
		r = int64(t)
	case int8:
		r = int64(t)
	case int16:
		r = int64(t)
	case int32:
		r = int64(t)
	case int64:
		r = t
	case *int64:
		r = *t
	case uint:
		r = int64(t)
	case uint8:
		r = int64(t)
	case uint16:
		r = int64(t)
	case uint32:
		r = int64(t)
	case uint64:
		r = int64(t)
	case float32:
		r = int64(t)
	case float64:
		r = int64(t)
	case bool:
		if t {
			r = 1
		}
	case string:
		r, err = strconv.ParseInt(t, 10, 64)
	default:
		err = castError(i, "int64")
	}
	return
}
252841
func MustDecodeUint64(input string) uint64 {
	dec, err := DecodeUint64(input)
	if err != nil {
		panic(err)
	}
	return dec
}
330925
func (d *Decoder) DecodeUint64() (uint64, error) {
	c, err := d.readCode()
	if err != nil {
		return 0, err
	}
	return d.uint(c)
}
620758
func decodeBase64(s string) ([]byte, error) {
	for i := 0; i < len(s)%4; i++ {
		s += "="
	}
	return base64.URLEncoding.DecodeString(s)
}
899730
func Base64() (string, error) {
	jsonBytes, err := json.Marshal(Version)
	if err != nil {
		return "", err
	}
	return base64.StdEncoding.EncodeToString(jsonBytes), nil
}
874314
func decryptBase64ToStdFormat(str string) string {
	str = strings.Replace(str, "-", "+", -1)
	str = strings.Replace(str, "_", "/", -1)
	str = strings.Replace(str, "~", "=", -1)
	return str
}
191419
func (env *Env) GetInt64(key string) int64 {
	s := strings.Trim(env.Get(key), " \t")
	val, err := strconv.ParseInt(s, 10, 64)
	if err != nil {
		return -1
	}
	return val
}
499250
func ToInt64(in interface{}) (int64, error) {
	if val, err := ToInt64E(in); err == nil {
		return val, nil
	}
	return 0, ErrBadType
}
575009
func (c *Cipher) Decrypt64(dst, src []uint64) {
    c.decrypt(src, dst)
}