Creating common token store and moving email invites and verification to it (#6213)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
0e007e344b
Коммит
9a87bb3af6
16
utils/hash.go
Обычный файл
16
utils/hash.go
Обычный файл
@@ -0,0 +1,16 @@
|
||||
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func HashSha256(text string) string {
|
||||
hash := sha256.New()
|
||||
hash.Write([]byte(text))
|
||||
|
||||
return fmt.Sprintf("%x", hash.Sum(nil))
|
||||
}
|
||||
Ссылка в новой задаче
Block a user