//go:build windows package yu_deflate // /* // #include "libdeflate.h" // */ // import "C" // import "unsafe" // // /* // Adler32 works as described in native/libs/libdeflate.h. // Returns 1 for in == nil // */ // func Adler32(adler32 uint32, in []byte) uint32 { // if in == nil { // return 1 // } // // addr := startMemAddr(in) // // checksum := C.libdeflate_adler32( // toUInt32(adler32), // unsafe.Pointer(addr), // toInt64(int64(len(in))), // ) // // return uint32(checksum) // } // // /* // Crc32 works as described in native/libs/libdeflate.h. // Returns 0 for in == nil // */ // func Crc32(buf []byte) uint32 { // if buf == nil { // return 0 // } // checksum, _, _ := syscall.SyscallN(addrlibdeflate_crc32, 0, // uintptr(unsafe.Pointer(&buf[0])), uintptr(len(buf)), // ) // return uint32(checksum) // } // // func startMemAddr(b []byte) *byte { // if len(b) > 0 { // return &b[0] // } // // b = append(b, 0) // ptr := &b[0] // b = b[0:0] // // return ptr // }