Quaternions
6bab1e1b6b
All checks were successful
continuous-integration/drone/push Build is passing
27 lines
478 B
Go
27 lines
478 B
Go
package model
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
|
|
"github.com/dchest/siphash"
|
|
)
|
|
|
|
func HashSource(source string) uint64{
|
|
return siphash.Hash(0, 0, []byte(source))
|
|
}
|
|
|
|
func HashFormat(hash uint64) string{
|
|
return fmt.Sprintf("%016x", hash)
|
|
}
|
|
|
|
type Script struct {
|
|
ID int64 `gorm:"primaryKey"`
|
|
Name string
|
|
Hash uint64
|
|
Source string
|
|
SubmissionID int64 // which submission did this script first appear in
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|