You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
186 B

  1. package main
  2. import (
  3. "crypto/sha256"
  4. "encoding/base64"
  5. )
  6. func hash(s string) string {
  7. h := sha256.New()
  8. h.Write([]byte(s))
  9. return base64.URLEncoding.EncodeToString(h.Sum(nil))
  10. }