library: c/openssl

This commit is contained in:
xushiwei
2024-07-30 01:35:49 +08:00
parent cc37097164
commit 42352d9f57
4 changed files with 140 additions and 0 deletions

18
_demo/cmd5demo/md5.go Normal file
View 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)
}