fix test error
This commit is contained in:
@@ -3,9 +3,12 @@ package main
|
|||||||
import (
|
import (
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
sum := sha256.Sum256([]byte("hello world\n"))
|
h := sha256.New()
|
||||||
fmt.Printf("%x", sum)
|
io.WriteString(h, "The fog is getting thicker!")
|
||||||
|
io.WriteString(h, "And Leon's getting laaarger!")
|
||||||
|
fmt.Printf("%x", h.Sum(nil))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,12 @@ package main
|
|||||||
import (
|
import (
|
||||||
"crypto/sha512"
|
"crypto/sha512"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
sum := sha512.Sum512([]byte("hello world\n"))
|
h := sha512.New()
|
||||||
fmt.Printf("%x", sum)
|
io.WriteString(h, "The fog is getting thicker!")
|
||||||
|
io.WriteString(h, "And Leon's getting laaarger!")
|
||||||
|
fmt.Printf("%x", h.Sum(nil))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package sha256
|
package sha256
|
||||||
|
|
||||||
// llgo:skipall
|
// llgo:skipall
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"hash"
|
"hash"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
@@ -67,3 +66,8 @@ func Sum256(data []byte) (ret [Size]byte) {
|
|||||||
openssl.SHA256Bytes(data, &ret[0])
|
openssl.SHA256Bytes(data, &ret[0])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Sum(data []byte) (ret [Size]byte) {
|
||||||
|
openssl.SHA256Bytes(data, &ret[0])
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package sha512
|
package sha512
|
||||||
|
|
||||||
// llgo:skipall
|
// llgo:skipall
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"hash"
|
"hash"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
@@ -73,6 +72,11 @@ func Sum512(data []byte) (ret [Size]byte) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Sum(data []byte) (ret [Size]byte) {
|
||||||
|
openssl.SHA512Bytes(data, &ret[0])
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func New512_224() hash.Hash {
|
func New512_224() hash.Hash {
|
||||||
panic("todo: New512_224")
|
panic("todo: New512_224")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user