From 11d151edcba7b6ac97af4fa1426bd37cafde931a Mon Sep 17 00:00:00 2001 From: simon987 Date: Sun, 12 Apr 2020 11:43:44 -0400 Subject: [PATCH] Update fastimagehash.go --- fastimagehash.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastimagehash.go b/fastimagehash.go index a46ea27..02dcbcb 100644 --- a/fastimagehash.go +++ b/fastimagehash.go @@ -162,14 +162,14 @@ func readAll(filepath string) ([]byte, error) { } func (h *Hash) ToHexStringReversed() (ret string) { - out := C.hash_to_hex_string_reversed_wr(unsafe.Pointer(&h.Bytes[0]), C.int(h.Size * h.Size / 8)) + out := C.hash_to_hex_string_reversed_wr(unsafe.Pointer(&h.Bytes[0]), C.int(h.Size)) ret = C.GoString(out) C.free(unsafe.Pointer(out)) return } func (h *Hash) ToHexString() (ret string) { - out := C.hash_to_hex_string_wr(unsafe.Pointer(&h.Bytes[0]), C.int(h.Size * h.Size / 8)) + out := C.hash_to_hex_string_wr(unsafe.Pointer(&h.Bytes[0]), C.int(h.Size)) ret = C.GoString(out) C.free(unsafe.Pointer(out)) return