⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adler32.~h

📁 Jpeg编解码器的源代码
💻 ~H
字号:
#ifndef CB__ADLER32_H
#define CB__ADLER32_H
//
// Copyright (c) 1997,1998 Colosseum Builders, Inc.
// All rights reserved.
//
// Colosseum Builders, Inc. makes no warranty, expressed or implied
// with regards to this software. It is provided as is.
//
// See the README.TXT file that came with this software for restrictions
// on the use and redistribution of this file or send E-mail to
// info@colosseumbuilders.com
//

//
//  Title:  PNG Checksum Function Declarations
//
//  Author:  John M. Miano  miano@colosseumbuilders.com
//
//  Description:
//
//    Adler32 Checksum Definition and Implementation
//

#include "systemspecific.h"

inline UBYTE4 Adler (UBYTE4 adler, UBYTE1 value)
{
  static const UBYTE4 prime = 65521 ;

  UBYTE4 lo = adler & 0xFFFF ;
  UBYTE4 hi = (adler >> 16) & 0xFFFF ;

  lo = (lo + value) % prime ;
  hi = (lo + hi) % prime ;
  UBYTE4 result = (hi << 16) | lo ;
  return result ;
}

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -