gpt4 book ai didi

java - Prince 类型中的方法 Encrypt(long, long, long, long, int) 不适用于参数 (String, long, long, long, int)

转载 作者:行者123 更新时间:2023-12-01 12:18:44 27 4
gpt4 key购买 nike

我无法找出为什么“加密”函数仍然将“消息”读取为字符串,尽管我已经使用不同的方法将数据类型更改为字节。

错误消息是“Prince 类型中的方法 Encrypt(long, long, long, long, int) 不适用于参数 (String, long, long, long, int)”。

btnSendSMS.setOnClickListener(new View.OnClickListener() 
{
public void onClick(View v, String args)
{
String phoneNo = txtPhoneNo.getText().toString();
String message = txtMessage.getText().toString();
if (phoneNo.length()>0 && message.length()>0){
//prince pri = new prince();
//message = toLong();
//byte[] data = message.getBytes("UTF-8");
//LongBuffer messageToLongBuffer;

//String str = message;
//byte[] array = str.getBytes();
String str = message;
byte[] bytes = message.getBytes();
prince.Encrypt (message, k0, kop, k1, t);

//maybe check to decrypt the ciphertext here
//prince.decrypt(message)
//sendSMS explore the sendDataMessage
sendSMS(phoneNo, message); }
else
Toast.makeText(getBaseContext(),
"Please enter both phone number and message.",
Toast.LENGTH_SHORT).show();
}

最佳答案

I could not find out why "Encrypt" function still reads "message" as string although I have changed the data type to bytes with different methods.

哈哈,更改你的代码:

 byte[] bytes = message.getBytes();
prince.Encrypt (bytes, k0, kop, k1, t); //HEREEEEEEEEEEEEE :)

关于java - Prince 类型中的方法 Encrypt(long, long, long, long, int) 不适用于参数 (String, long, long, long, int),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26836411/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com