From 9a87bb3af68216b53ee8f89d6604c715c7b85b2d Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Thu, 27 Apr 2017 10:55:03 -0400 Subject: Creating common token store and moving email invites and verification to it (#6213) --- utils/hash.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 utils/hash.go (limited to 'utils') diff --git a/utils/hash.go b/utils/hash.go new file mode 100644 index 000000000..cc82fd94b --- /dev/null +++ b/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)) +} -- cgit v1.2.3-1-g7c22