probo/models/question.go
2023-12-05 22:11:08 +01:00

19 lines
263 B
Go

package models
import (
"crypto/sha256"
"fmt"
)
type Question struct {
Meta
Text string `json:"text"`
}
func (q *Question) String() string {
return q.Text
}
func (q *Question) GetHash() string {
return fmt.Sprintf("%x", sha256.Sum256([]byte(q.Text)))
}