Skip to content
Snippets Groups Projects
Select Git revision
  • ce7065752f45b1d1591e2d590ac7a35fa5719708
  • main default protected
  • v1.302.0
  • v1.301.0
  • v1.300.0
  • v1.299.0
  • v1.298.0
  • v1.297.0
  • v1.296.0
  • v1.295.0
  • v1.294.0
  • v1.293.0
  • v1.292.0
  • v1.291.0
  • v1.290.0
  • v1.289.0
  • v1.288.0
  • v1.287.0
  • v1.286.0
  • v1.285.0
  • v1.284.0
  • v1.283.0
22 results

encryption.go

Blame
  • encryption.go 270 B
    package encryption
    
    import (
    	"crypto/hmac"
    	"crypto/sha256"
    	"encoding/base64"
    )
    
    func Hash(input string, key string) string {
    	keyBytes := []byte(key)
    	h := hmac.New(sha256.New, keyBytes)
    	h.Write([]byte(input))
    	return base64.StdEncoding.EncodeToString(h.Sum(nil))
    }