mirror of
https://github.com/qrtc/ffmpeg-dev-go.git
synced 2025-10-05 15:47:33 +08:00
2023-10-24 21:24:55 CST W43D2
This commit is contained in:
28
avutil_ripemd.go
Normal file
28
avutil_ripemd.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
#include <libavutil/ripemd.h>
|
||||
*/
|
||||
import "C"
|
||||
|
||||
type AVRIPEMD C.struct_AVRIPEMD
|
||||
|
||||
// AvRipemdAlloc allocates an AVRIPEMD context.
|
||||
func AvRipemdAlloc() *AVRIPEMD {
|
||||
return (*AVRIPEMD)(C.av_ripemd_alloc())
|
||||
}
|
||||
|
||||
// AvRipemdInit initializes RIPEMD hashing.
|
||||
func AvRipemdInit(context *AVRIPEMD, bits int32) int32 {
|
||||
return (int32)(C.av_ripemd_init((*C.struct_AVRIPEMD)(context), (C.int)(bits)))
|
||||
}
|
||||
|
||||
// AvRipemdUpdate updates hash value.
|
||||
func AvRipemdUpdate(context *AVRIPEMD, data *uint8, len uint32) {
|
||||
C.av_ripemd_update((*C.struct_AVRIPEMD)(context), (*C.uint8_t)(data), (C.uint)(len))
|
||||
}
|
||||
|
||||
// AvRipemdFinal finishes hashing and output digest value.
|
||||
func AvRipemdFinal(context *AVRIPEMD, digest *uint8) {
|
||||
C.av_ripemd_final((*C.struct_AVRIPEMD)(context), (*C.uint8_t)(digest))
|
||||
}
|
Reference in New Issue
Block a user