您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

会PHP的大婶帮忙把这个函数翻译成C#的~~

2024/6/5 22:51:51发布30次查看
using system; using system.text; using system.security.cryptography; public class program { private const string key = key ; private const string message = message ; private static readonly encoding encoding = encoding.utf8; static
using system;
using system.text;
using system.security.cryptography;
public class program {
private const string key = key;
private const string message = message;
private static readonly encoding encoding = encoding.utf8;
static void main(string[] args) {
var keybyte = encoding.getbytes(key);
using (var hmacsha256 = new hmacsha256(keybyte)) { hmacsha256.computehash(encoding.getbytes(message));
console.writeline(result: {0}, bytetostring(hmacsha256.hash));
}
}
static string bytetostring(byte[] buff) {
string sbinary = ;
for (int i = 0; i )
sbinary += buff[i].tostring(x2);
/* hex format */ return sbinary; }
}
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product