首页 > 其他 > 详细

帧校验序列码FCS

时间:2018-11-22 21:29:48      阅读:135      评论:0      收藏:0      [点我收藏+]

private static string FCS(string s)
{
int xorResult = 0;
string tempfes = "";
for (int i = 0; i < s.Length; i++)
{
xorResult = xorResult ^ Convert.ToInt32(s[i]);
}
tempfes = Convert.ToString(xorResult, 16);
//补0
if (tempfes.Length == 1)
{
tempfes = "0" + tempfes;
}
return tempfes.ToUpper().Replace(" ","");
}

帧校验序列码FCS

原文:https://www.cnblogs.com/zhangsir95/p/10004045.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!