api_func_sha224.go 286 B

123456789101112131415161718192021
  1. package main
  2. import (
  3. "crypto/sha256"
  4. "encoding/hex"
  5. "fmt"
  6. "os"
  7. )
  8. func main() {
  9. call_arg := os.Args[1:]
  10. data := call_arg[0]
  11. hasher := sha256.New224()
  12. hasher.Write([]byte(data))
  13. hash_byte := hasher.Sum(nil)
  14. hash_str := hex.EncodeToString(hash_byte)
  15. fmt.Print(hash_str)
  16. }