PHP » GoLang |
login |
register |
about
|
cryptcrypt[code=golang] package main import ( "fmt" "github.com/tredoe/osutil/user/crypt/md5_crypt" ) func main() { salt := "$1$00000000$" md5Crypt := md5_crypt.New() key := "string" func main() { salt := "$1$00000000$" md5Crypt := md5_crypt.New() key := "string" hash, err := md5Crypt.Generate([]byte(key), []byte(salt)) if err != nil { fmt.Println(err.Error()) return } fmt.Println(hash) } } [/code] |