Files
Reloader/internal/pkg/crypto/sha.go
faizanahmad055 157cf0f2e4 Remove SHA1 changes
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
2026-01-07 12:13:04 +01:00

21 lines
369 B
Go

package crypto
import (
"crypto/sha1"
"fmt"
"io"
"github.com/sirupsen/logrus"
)
// GenerateSHA generates SHA from string
func GenerateSHA(data string) string {
hasher := sha1.New()
_, err := io.WriteString(hasher, data)
if err != nil {
logrus.Errorf("Unable to write data in hash writer %v", err)
}
sha := hasher.Sum(nil)
return fmt.Sprintf("%x", sha)
}