package main import ( "encoding/hex" ) type Hash struct { Hash string `json:"hash"` } func NewHash(hash []byte) *Hash { return &Hash{Hash: hex.EncodeToString(hash)} }