mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-04-27 01:48:20 -05:00
12 lines
206 B
Go
12 lines
206 B
Go
package utils
|
|
|
|
import (
|
|
"crypto/sha256"
|
|
"fmt"
|
|
)
|
|
|
|
// Sha256 calculates a sha256 hash from a string
|
|
func Sha256(cleartext string) string {
|
|
return fmt.Sprintf("%x", sha256.Sum256([]byte(cleartext)))[:45]
|
|
}
|