Skip to content

Latest commit

 

History

History

xhash

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

GoKit - xhash

Hash kits for Golang development.

Installation

go get -u github.com/likexian/gokit

Importing

import (
    "github.com/likexian/gokit/xhash"
)

Documentation

Visit the docs on GoDoc

Example

Get md5 of string

h := xhash.Md5("12345678")
fmt.Println(h.Hex())
fmt.Println(h.B64())

Get Hmac Md5 of string

h := xhash.HmacMd5("key", "12345678")
fmt.Println(h.Hex())
fmt.Println(h.B64())

Get md5 of file

h, err := xhash.FileMd5("xhash.go")
if err != nil {
    panic(err)
}
fmt.Println(h.Hex())
fmt.Println(h.B64())

License

Copyright 2012-2024 Li Kexian

Licensed under the Apache License 2.0

Donation

If this project is helpful, please share it with friends.

If you want to thank me, you can give me a cup of coffee.