-
-
Save parzibyte/3bf04510277e12c1380927de2dd2906e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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