资源简介
1.0.0.03.7z
代码片段和文件信息
/****************************************************************************
Copyright(c) 2005 by Intellon Corp. ALL RIGHTS RESERVED.
This Information is proprietary to Intellon Corporation Ocala Florida
(Intellon) and MAY NOT be copied by any method or incorporated into
another program without the express written consent of Intellon. This
Information or any portion thereof remains the property of Intellon. The
Information contained herein is believed to be accurate and Intellon
assumes no responsibility or liability for its use in any way and conveys
no license or title under any patent or copyright and makes no
representation or warranty that this Information is free from patent or
copyright infringement.
File: CheckSum.cpp
Author(s): Patrick Tse
Nozar Kianian Fard 2005/09/07
Contains: CheckSum Library
--
$File: //eng/sw/panther/releases/1.1.0/main/publically_disclosed/common/CheckSum.cpp $
$Revision: #1 $
$Change: 179672 $
$Author: nickk $
$DateTime: 2012/05/08 13:49:12 $
****************************************************************************/
#include “CheckSum.h“
// ---------------------------------------------------------------------------
//
// Function: CCCheckSum::VerifyCheckSum()
//
// ---------------------------------------------------------------------------
bool CCCheckSum::VerifyCheckSum(
const uint32* pBufferPtr
uint32 aLength_Wds
uint32 aGivenCheckSum
)
{
uint32 CheckSum = CCCheckSum::GenerateCheckSum( pBufferPtr aLength_Wds );
return (CheckSum == aGivenCheckSum);
}
// ---------------------------------------------------------------------------
//
// Function: CCCheckSum::GenerateCheckSum()
//
// ---------------------------------------------------------------------------
uint32 CCCheckSum::GenerateCheckSum(
const uint32* pBufferPtr
uint32 aLength_Wds
)
{
uint32 CheckSum;
uint32 vpBufferPtr = (uint32)pBufferPtr;
if (vpBufferPtr & 0x3)
{
CheckSum = CCCheckSum::Calc32bitXor( pBufferPtr aLength_Wds );
}
else
{
CheckSum = CCCheckSum::Calc32bitXor_address_word_aligned(pBufferPtr aLength_Wds );
}
CheckSum = FinalizeCumulativeChecksum( CheckSum );
return( CheckSum );// return Checksum
}
// ---------------------------------------------------------------------------
uint32 CCCheckSum::GenerateCumulativeChecksum(
uint32 aAccumulatedSoFar
const uint32 * apBufferPtr
uint32 aLength_Wds
)
{
uint32 vpBufferPtr = (uint32)apBufferPtr;
if (vpBufferPtr & 0x3)
{
return aAccumulatedSoFar ^ CCCheckSum::Calc32bitXor( apBufferPtr aLength_Wds );
}
return aAccumulatedSoFar ^ CCCheckSum::Calc32bitXor_address_word_aligned(apBufferPtr aLength_Wds );
}
uint32 CCCheckSum::FinalizeCumulativeChecksum(
uint32 aAccumulatedSoFar
) {
//-* One‘s Compliment *-//
return ~aAccumulatedSoFar;
}
// ----------------------------------------
- 上一篇:矩阵计算英文原版pdf
- 下一篇:Unity 2d休闲游戏《 打地鼠》源码
相关资源
- a84fdbbed7bb8526f2fe3e5b03d22852.rar
- extract_es.rar
-
ob
ject-Oriented_Software_Construction中英版 - 02_Sm.project.zip
- 毕业证套打印带完整源码数据库.rar
- 20套大数据大屏BI分析模板_js_echarts.
- TecnomatixPlantSimulation案例.zip
- 电机学第4版.pdf
- gcc.rar
- 明细打印最新版.zip
- 完整版本2.rar
- CASS正版10.1注册写狗ET199.zip
- ereererere.zip
- 计网实验.zip
- 卫星导航定位于北斗系统应用论文集
- 9408efb3c3adaaf800fe5a3a1932c2df.rar
- DataToOneCode.zip
- 1a40e3362e14cb44cee2e254240d631a.rar
- 481f6c37d89aafa8fbe0cab4b0b64123.rar
- 李航—统计学习方法.rar
- XS.zip
- kali-linux无线渗透测试入门指南中文版
- OptiSystem.v7.0.part1.rar
- cocosCreatorjs麻将游戏.rar
- 李明洋PCB天线设计和HFSS仿真分析视频
- 3d6d58e5e3c54e5fa63417619c3d8a47.pdf
- TexturePacker4.11破解版.rar
- 人脸识别原理及算法动态人脸识别系
- Quosa807054破解.7z
- 电力拖动自动控制系统(第4版)(陈
评论
共有 条评论