mirror of
https://github.com/versia-pub/versia-go.git
synced 2026-03-13 04:29:15 +01:00
chore: init
This commit is contained in:
commit
320715f3e7
174 changed files with 42083 additions and 0 deletions
22
internal/helpers/crypto.go
Normal file
22
internal/helpers/crypto.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package helpers
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"time"
|
||||
)
|
||||
|
||||
func HashSHA256(data []byte) []byte {
|
||||
h := sha256.New()
|
||||
|
||||
h.Write(data)
|
||||
|
||||
return h.Sum(nil)
|
||||
}
|
||||
|
||||
func ISO8601(t time.Time) string {
|
||||
return t.Format("2006-01-02T15:04:05Z")
|
||||
}
|
||||
|
||||
func ParseISO8601(s string) (time.Time, error) {
|
||||
return time.Parse("2006-01-02T15:04:05Z", s)
|
||||
}
|
||||
5
internal/helpers/ptr.go
Normal file
5
internal/helpers/ptr.go
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
package helpers
|
||||
|
||||
func StringPtr(s string) *string {
|
||||
return &s
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue