Standard library / crypto/md5
crypto/md5.Sum()
Compute the MD5 digest of a complete byte slice. Cryptographically broken for collision resistance; use only for unavoidable legacy compatibility, never new signatures or adversarial integrity checks. Expected stdout: '900150983cd24fb0d6963f7d28e17f72\n'.
Formal Syntax & Structure
go syntaxgo
func Sum(data []byte) [Size]byteParameters & Attributes
| Name | Type | Description |
|---|---|---|
| data | []byte | Exact input bytes to hash. |
Return Value
[Size]byte
Fixed-size MD5 digest.
Working Example
Example Snippetgo
package main
import ( "crypto/md5" "fmt")
func main() { fmt.Printf("%x\n", md5.Sum([]byte("abc"))) }