library: c/openssl
This commit is contained in:
18
_demo/cmd5demo/md5.go
Normal file
18
_demo/cmd5demo/md5.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goplus/llgo/c/openssl"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var md5 openssl.MD5_CTX
|
||||
var h = make([]byte, openssl.MD5_LBLOCK)
|
||||
md5.Init()
|
||||
md5.UpdateString("The fog is getting thicker!")
|
||||
md5.UpdateString("And Leon's getting laaarger!")
|
||||
md5.Final(unsafe.Pointer(unsafe.SliceData(h)))
|
||||
fmt.Printf("%x", h)
|
||||
}
|
||||
Reference in New Issue
Block a user