Documentation
¶
Index ¶
- Constants
- Variables
- func BBytes(args ...interface{}) []byte
- func BFloat32(data interface{}) float32
- func BFloat64(data interface{}) float64
- func BInt(data interface{}) int
- func BInt8(data interface{}) int8
- func BInt16(data interface{}) int16
- func BInt32(data interface{}) int32
- func BInt64(data interface{}) int64
- func BRune(data interface{}) rune
- func BUint(data interface{}) uint
- func BUint8(data interface{}) uint8
- func BUint16(data interface{}) uint16
- func BUint32(data interface{}) uint32
- func BUint64(data interface{}) uint64
- func BUintptr(data interface{}) uintptr
- func Base64_decode(str string) string
- func Base64_encode(str string) string
- func Bool(data interface{}) bool
- func Byte(data interface{}) byte
- func Bytes(args ...interface{}) []byte
- func Float32(data interface{}) float32
- func Float64(data interface{}) float64
- func GetSalt(count int) string
- func GetSaltedPassword(password, salt string) string
- func Int(data interface{}) int
- func Int8(data interface{}) int8
- func Int16(data interface{}) int16
- func Int32(data interface{}) int32
- func Int64(data interface{}) int64
- func IsBigEndian() bool
- func IsLittleEndian() bool
- func Md5(str string) string
- func Md5_file(filepath string) (string, error)
- func QuotedPrintableDecode(data string) string
- func Rune(data interface{}) rune
- func Sha1(data string) string
- func String(data interface{}) string
- func Uint(data interface{}) uint
- func Uint8(data interface{}) uint8
- func Uint16(data interface{}) uint16
- func Uint32(data interface{}) uint32
- func Uint64(data interface{}) uint64
- func Uintptr(data interface{}) uintptr
- type PageData
Constants ¶
View Source
const ( IntType = iota UintType Int64Type Uint64Type Int32Type Uint32Type Int16Type Uint16Type Int8Type Uint8Type Float64Type Float32Type StringType BoolType )
View Source
const INT_SIZE int = int(unsafe.Sizeof(0))
以下代码判断机器大小端
Variables ¶
View Source
var Endian binary.ByteOrder
保存机器大小端
View Source
var TypeStr []string = []string{
"IntType",
"UintType",
"Int64Type",
"Uint64Type",
"Int32Type",
"Uint32Type",
"Int16Type",
"Uint16Type",
"Int8Type",
"Uint8Type",
"Float64Type",
"Float32Type",
"StringType",
"BoolType",
}
Functions ¶
func Base64_decode ¶
func Base64_encode ¶
func GetSaltedPassword ¶
func IsBigEndian ¶
func IsBigEndian() bool
func IsLittleEndian ¶
func IsLittleEndian() bool
func QuotedPrintableDecode ¶
============================================================================================
func Sha1 ¶
============================================================================================
func Base64Encode(data string) string {
var buf bytes.Buffer
encoder := base64.NewEncoder(base64.StdEncoding, &buf)
encoder.Write([]byte(data))
encoder.Close()
return buf.String()
}
/* ============================================================================================ */
func Base64Decode(data string) string {
data = strings.Replace(data, "\r", "", -1)
data = strings.Replace(data, "\n", "", -1)
var buf = bytes.NewBufferString(data)
var res bytes.Buffer
decoder := base64.NewDecoder(base64.StdEncoding, buf)
res.ReadFrom(decoder)
return res.String()
}
/* ============================================================================================ */
func Md5(data string) string {
var h = md5.New()
h.Write([]byte(data))
return fmt.Sprintf("%x", h.Sum(nil))
}
============================================================================================
Types ¶
Click to show internal directories.
Click to hide internal directories.