Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 24, 2022 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/3bf04510277e12c1380927de2dd2906e to your computer and use it in GitHub Desktop.
Save parzibyte/3bf04510277e12c1380927de2dd2906e to your computer and use it in GitHub Desktop.
func hashearMensaje(mensaje string) ([]byte, error) {
mensajeComoBytes := []byte(mensaje)
hasheador := sha256.New()
_, err := hasheador.Write(mensajeComoBytes)
if err != nil {
return []byte{}, err
}
return hasheador.Sum(nil), nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment