Fix bug where I am bad at computer

This commit is contained in:
kayos@tcp.direct 2022-03-26 20:17:56 -07:00
parent 2fd6077f11
commit a0deb4012d
Signed by: kayos
GPG Key ID: 4B841471B4BEE979
3 changed files with 5 additions and 2 deletions

2
.gitignore vendored Normal file

@ -0,0 +1,2 @@
.idea/
b2sum

@ -12,9 +12,10 @@ import (
func C264(i io.Reader) string {
hashr, _ := blake2b.New(64, nil)
cytes, err := io.ReadAll(i)
hashr.Write(cytes)
if err != nil {
println(err.Error())
os.Exit(1)
}
return base64.StdEncoding.EncodeToString(hashr.Sum(cytes))
return base64.StdEncoding.EncodeToString(hashr.Sum(nil))
}

@ -6,7 +6,7 @@ import (
"testing"
)
const kayos = `a2F5b3MKeGoC90IBWQPGxv2FJVLScpEvR0DhWEdhiobiF/cfVBnSXhAxr+5YUxOJZESTTrBLkDpoWxRIt1XVb3Aa/pvizg==`
const kayos = `Kr+6ONDx+cq/WvhHpQE/4LVuJYi9QHz1TztHNTWwa9KJWqHxfTNLKF3YxrcLptA3wO0KHm83Lq7gpBWgCQzPag==`
func TestC264(t *testing.T) {
soyak := C264(strings.NewReader("kayos\n"))