1package custom_comparator
2
3//#include <stdlib.h>
4import "C"
5
6import (
7	"bytes"
8	"unsafe"
9)
10
11//export CompareBytesReversed
12func CompareBytesReversed(k1 unsafe.Pointer, k1len C.size_t, k2 unsafe.Pointer, k2len C.size_t) int {
13	key1 := C.GoBytes(k1, C.int(k1len))
14	key2 := C.GoBytes(k2, C.int(k2len))
15	return -bytes.Compare(key1, key2)
16}
17