From f67b15b9268e57c32616fdb06d29c0ab8d7196ba Mon Sep 17 00:00:00 2001 From: tsingbx Date: Wed, 31 Jul 2024 14:28:15 +0800 Subject: [PATCH] fix test fail --- _cmptest/sha1demo/sha1.go | 7 +++++-- internal/lib/crypto/sha1/sha1.go | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/_cmptest/sha1demo/sha1.go b/_cmptest/sha1demo/sha1.go index e2f0d0ed..dbd813c7 100644 --- a/_cmptest/sha1demo/sha1.go +++ b/_cmptest/sha1demo/sha1.go @@ -3,9 +3,12 @@ package main import ( "crypto/sha1" "fmt" + "io" ) func main() { - data := []byte("This page intentionally left blank.") - fmt.Printf("% x", sha1.Sum(data)) + h := sha1.New() + io.WriteString(h, "The fog is getting thicker!") + io.WriteString(h, "And Leon's getting laaarger!") + fmt.Printf("%x", h.Sum(nil)) } diff --git a/internal/lib/crypto/sha1/sha1.go b/internal/lib/crypto/sha1/sha1.go index 0779e917..93637a51 100644 --- a/internal/lib/crypto/sha1/sha1.go +++ b/internal/lib/crypto/sha1/sha1.go @@ -1,7 +1,6 @@ package sha1 // llgo:skipall - import ( "hash" "unsafe"