// Code generated by kitcom. DO NOT EDIT.

package main

import (
	kittenipc "efprojects.com/kitten-ipc"
	"encoding/base64"
	"fmt"
)

type TsIpcApi struct {
	Ipc kittenipc.IpcCommon
}

func (self *TsIpcApi) Div(
	a int, b int,
) (
	int, error,
) {
	results, err := self.Ipc.Call("TsIpcApi.Div", a, b)
	if err != nil {
		return 0, fmt.Errorf("call to TsIpcApi.Div failed: %w", err)
	}

	return int(results[0].(float64)), nil
}

func (self *TsIpcApi) XorData(
	data1 []byte, data2 []byte,
) (
	[]byte, error,
) {
	results, err := self.Ipc.Call("TsIpcApi.XorData", data1, data2)
	if err != nil {
		return []byte{}, fmt.Errorf("call to TsIpcApi.XorData failed: %w", err)
	}

	results[0], err = base64.StdEncoding.DecodeString(results[0].(string))
	if err != nil {
		return []byte{}, fmt.Errorf("call to TsIpcApi.XorData: error decoding blob: %w", err)
	}

	return results[0].([]byte), nil
}
