Created
January 29, 2018 05:16
-
-
Save nosequeldeebee/a4953a59257c21fc706319fadc6b9ac1 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 calculateHash(block Block) string { | |
record := string(block.Index) + block.Timestamp + string(block.BPM) + block.PrevHash | |
h := sha256.New() | |
h.Write([]byte(record)) | |
hashed := h.Sum(nil) | |
return hex.EncodeToString(hashed) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment