Skip to content

Instantly share code, notes, and snippets.

@athom
Created July 7, 2014 09:37
Show Gist options
  • Save athom/4966d3553965a5917b7e to your computer and use it in GitHub Desktop.
Save athom/4966d3553965a5917b7e to your computer and use it in GitHub Desktop.
func TestSha1(t *testing.T) {
v := map[string]string{"name": "Felix", "age": "18"}
e := &v
//e := &[]string{"hi"}
sh1 := sha1.New()
io.WriteString(sh1, "q3244214")
ge := gob.NewEncoder(sh1)
ge.Encode(e)
fmt.Println(".........!")
fmt.Println(sh1.Sum(nil))
sh1 = sha1.New()
io.WriteString(sh1, "q3244214")
ge = gob.NewEncoder(sh1)
ge.Encode(e)
fmt.Println(sh1.Sum(nil))
sh1 = sha1.New()
io.WriteString(sh1, "q3244214")
ge = gob.NewEncoder(sh1)
ge.Encode(e)
fmt.Println(sh1.Sum(nil))
sh1 = sha1.New()
io.WriteString(sh1, "q3244214")
ge = gob.NewEncoder(sh1)
ge.Encode(e)
fmt.Println(sh1.Sum(nil))
sh1 = sha1.New()
io.WriteString(sh1, "q3244214")
ge = gob.NewEncoder(sh1)
ge.Encode(e)
fmt.Println(sh1.Sum(nil))
sh1 = sha1.New()
io.WriteString(sh1, "q3244214")
ge = gob.NewEncoder(sh1)
ge.Encode(e)
fmt.Println(sh1.Sum(nil))
sh1 = sha1.New()
io.WriteString(sh1, "q3244214")
ge = gob.NewEncoder(sh1)
ge.Encode(e)
fmt.Println(sh1.Sum(nil))
t.Errorf("done")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment