Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4. "crypto/md5"
  5. "fmt"
  6. "os"
  7. )
  8.  
  9. func main() {
  10. var data []byte
  11. if len(os.Args) < 2 {
  12. usage()
  13. } else {
  14. data = []byte(string(os.Args[1]))
  15. fmt.Printf("%s - %x", data, md5.Sum(data))
  16.  
  17. }
  18. }
  19.  
  20. func usage() {
  21. fmt.Printf(`You need to provide string. For example
  22. '%s A-Home' will give you 0cbc6611f5540bd0809a388dc95a615b↵`, os.Args[0])
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement