Skip to content

Instantly share code, notes, and snippets.

@sergiotapia
Last active August 19, 2025 09:37
Show Gist options
  • Select an option

  • Save sergiotapia/8263278 to your computer and use it in GitHub Desktop.

Select an option

Save sergiotapia/8263278 to your computer and use it in GitHub Desktop.

Revisions

  1. sergiotapia revised this gist Jan 5, 2014. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions md5-example.go
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,8 @@
    import (
    "crypto/md5"
    "encoding/hex"
    )

    func GetMD5Hash(text string) string {
    hasher := md5.New()
    hasher.Write([]byte(text))
  2. sergiotapia created this gist Jan 5, 2014.
    5 changes: 5 additions & 0 deletions md5-example.go
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    func GetMD5Hash(text string) string {
    hasher := md5.New()
    hasher.Write([]byte(text))
    return hex.EncodeToString(hasher.Sum(nil))
    }