Documentation ¶
Overview ¶
Example (File) ¶
package main import ( "fmt" "os" "github.com/recallsong/go-utils/encoding/md5x" ) func main() { file, err := os.Open("md5x.go") if err != nil { fmt.Println("error:", err) return } val, err := md5x.SumFile(file) fmt.Println(val.String(), err) }
Output: 25d81829d5e7219164dc00a297fc579b <nil>
Example (FileByPath) ¶
package main import ( "fmt" "github.com/recallsong/go-utils/encoding/md5x" ) func main() { val, err := md5x.SumFileByPath("md5x.go") fmt.Println(val.String(), err) }
Output: 25d81829d5e7219164dc00a297fc579b <nil>
Example (Short) ¶
package main import ( "fmt" "github.com/recallsong/go-utils/encoding/md5x" ) func main() { val, err := md5x.SumFileByPath("md5x.go") fmt.Println(val.String16(), err) }
Output: 081a33d327980264 <nil>
Example (Sum) ¶
package main import ( "fmt" "github.com/recallsong/go-utils/encoding/md5x" ) func main() { str := md5x.Sum([]byte("123")).String() fmt.Println(str) }
Output: 202cb962ac59075b964b07152d234b70
Example (SumString) ¶
package main import ( "fmt" "github.com/recallsong/go-utils/encoding/md5x" ) func main() { str := md5x.SumString("123").String() fmt.Println(str) }
Output: 202cb962ac59075b964b07152d234b70
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result []byte
Result md5的结果
func (Result) UpperString16 ¶
UpperString16 获取md5的16位的大写的string类型结果
Click to show internal directories.
Click to hide internal directories.