图解安装CentOS 5.2
2010-09-18 00:57
253 查看
package com.fg.water;
public class CRCTest {
/**
* @param args
*/
public static void main(String[] args) {
String temp = "ST=32;CN=2011;PW=122333;MN=88888880000005;CP=&&DataTime=20120416225856;060-Rtd=0.06,060-Flag=N;011-Rtd=0.00,011-Flag=N;001-Rtd=7.64,001-Flag=N&&";
// ##0077QN=20120416225111069;ST=91;CN=9021;PW=122333;MN=88888880000006;Flag=1;CP=&&&&4100
// ##0144ST=32;CN=2011;PW=122333;MN=88888880000005;CP=&&DataTime=20120416225856;060-Rtd=0.06,060-Flag=N;011-Rtd=0.00,011-Flag=N;001-Rtd=7.64,001-Flag=N&&3AC0
Integer[] regs = new Integer[temp.length()];
for (int i = 0; i < temp.length(); i++) {
regs[i] = (int) temp.charAt(i);
}
int por = 0xFFFF;
for (int j = 0; j < regs.length; j++) {
por = por >> 8;
por ^= regs[j];
for (int i = 0; i < 8; i++) {
if ((por & 0x01) == 1) {
por = por >> 1;
por = por ^ 0xa001;
} else
por = por >> 1;
}
}
System.out.println(Integer.toHexString(por));
}
}
public class CRCTest {
/**
* @param args
*/
public static void main(String[] args) {
String temp = "ST=32;CN=2011;PW=122333;MN=88888880000005;CP=&&DataTime=20120416225856;060-Rtd=0.06,060-Flag=N;011-Rtd=0.00,011-Flag=N;001-Rtd=7.64,001-Flag=N&&";
// ##0077QN=20120416225111069;ST=91;CN=9021;PW=122333;MN=88888880000006;Flag=1;CP=&&&&4100
// ##0144ST=32;CN=2011;PW=122333;MN=88888880000005;CP=&&DataTime=20120416225856;060-Rtd=0.06,060-Flag=N;011-Rtd=0.00,011-Flag=N;001-Rtd=7.64,001-Flag=N&&3AC0
Integer[] regs = new Integer[temp.length()];
for (int i = 0; i < temp.length(); i++) {
regs[i] = (int) temp.charAt(i);
}
int por = 0xFFFF;
for (int j = 0; j < regs.length; j++) {
por = por >> 8;
por ^= regs[j];
for (int i = 0; i < 8; i++) {
if ((por & 0x01) == 1) {
por = por >> 1;
por = por ^ 0xa001;
} else
por = por >> 1;
}
}
System.out.println(Integer.toHexString(por));
}
}
相关文章推荐
- 全程图解:Centos5.2 操作系统安装
- 全程图解:Centos 5.2 下 ORACLE10G 安装配置
- VMware下CentOS5.5安装全过程(图解)
- U盘安装centos 6.3教程(超级详细图解教程) (转)
- CentOS 6.0图解网络安装全过程
- Centos5.2下载安装ZendStudio for Linux
- CentOS 下 Oracle 10g 安装 + 配置 全过程(图解)
- CentOS5.2的Apache安装
- CentOS 6.0 图形(图解)安装教程
- Linux——centos环境部署--一Tomcat安装图解
- [Linux CentOS6.2] CentOS 6.2 详细安装教程(全图解,转载)
- 在阿里云 centos 6.3上面安装php5.2(转)
- Cacti的安装(for CentOS 5.2)
- 图解CentOS6.8安装详情
- CentOS 6.3安装(详细图解教程)
- CentOS 6.4 服务器版安装教程(超级详细图解)
- 【经验】CentOS 5.2 下用Yum安装Apache+PHP+MySQL环境
- Centos 7安装与配置nagios监控详细图解(二)
- CentOS 5.2安装nagios实现短信告警
- CentOS 6.5系统安装配置图解教程(详细图文)