java websocket sha1_mywebsocket

/*

* sha1.h

*

* Copyright (C) 1998, 2009

* Paul E. Jones

* All Rights Reserved.

*

*****************************************************************************

* $Id: sha1.h 12 2009-06-22 19:34:25Z paulej $

*****************************************************************************

*

* Description:

* This class implements the Secure Hashing Standard as defined

* in FIPS PUB 180-1 published April 17, 1995.

*

* Many of the variable names in this class, especially the single

* character names, were used because those were the names used

* in the publication.

*

* Please read the file sha1.cpp for more information.

*

*/

#ifndef _SHA1_H_

#define _SHA1_H_

class SHA1

{

public:

SHA1();

virtual ~SHA1();

/*

* Re-initialize the class

*/

void Reset();

/*

* Returns the message digest

*/

bool Result(unsigned *message_digest_array);

/*

* Provide input to SHA1

*/

void Input( const unsigned char *message_array,

unsigned length);

void Input( const char *message_array,

unsigned length);

void Input(unsigned char message_element);

void Input(char message_element);

SHA1& operator<

SHA1& operator<

SHA1& operator<

SHA1& operator<

private:

/*

* Process the next 512 bits of the message

*/

void ProcessMessageBlock();

/*

* Pads the current message block to 512 bits

*/

void PadMessage();

/*

* Performs a circular left shift operation

*/

inline unsigned CircularShift(int bits, unsigned word);

unsigned H[5]; // Message digest buffers

unsigned Length_Low; // Message length in bits

unsigned Length_High; // Message length in bits

unsigned char Message_Block[64]; // 512-bit message blocks

int Message_Block_Index; // Index into message block array

bool Computed; // Is the digest computed?

bool Corrupted; // Is the message digest corruped?

};

#endif // _SHA1_H_

一键复制

编辑

Web IDE

原始数据

按行查看

历史

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值