Sese Framework  x.y.z
A cross-platform framework
载入中...
搜索中...
未找到
sese::MD5Util类 参考

MD5 算法类 更多...

#include <MD5Util.h>

Public 类型

using OutputStream = sese::io::OutputStream
 工具所用输出流
 
using InputStream = sese::io::InputStream
 工具所用输入流
 

静态 Public 成员函数

static void encode (const InputStream::Ptr &input, const OutputStream::Ptr &output) noexcept
 生成 MD5 信息
 
static void encode (InputStream *input, OutputStream *output) noexcept
 生成 MD5 信息
 
static std::unique_ptr< char[]> encode (const InputStream::Ptr &input, bool is_cap=true) noexcept
 生成 32 位大写 MD5 字符串
 
static std::unique_ptr< char[]> encode (InputStream *input, bool is_cap=true) noexcept
 生成 32 位大写 MD5 字符串
 

静态 Private 成员函数

static void transform (uint32_t *res, uint8_t *buffer) noexcept
 用于进行变换操作
 
static uint32_t F (uint32_t x, uint32_t y, uint32_t z) noexcept
 
static uint32_t G (uint32_t x, uint32_t y, uint32_t z) noexcept
 
static uint32_t H (uint32_t x, uint32_t y, uint32_t z) noexcept
 
static uint32_t I (uint32_t x, uint32_t y, uint32_t z) noexcept
 
static uint32_t FF (uint32_t a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint32_t s, uint32_t t) noexcept
 
static uint32_t GG (uint32_t a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint32_t s, uint32_t t) noexcept
 
static uint32_t HH (uint32_t a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint32_t s, uint32_t t) noexcept
 
static uint32_t II (uint32_t a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint32_t s, uint32_t t) noexcept
 

静态 Private 属性

static const uint32_t A = 0x67452301
 
static const uint32_t B = 0xefcdab89
 
static const uint32_t C = 0x98badcfe
 
static const uint32_t D = 0x10325476
 
static const uint32_t S11 = 7
 
static const uint32_t S12 = 12
 
static const uint32_t S13 = 17
 
static const uint32_t S14 = 22
 
static const uint32_t S21 = 5
 
static const uint32_t S22 = 9
 
static const uint32_t S23 = 14
 
static const uint32_t S24 = 20
 
static const uint32_t S31 = 4
 
static const uint32_t S32 = 11
 
static const uint32_t S33 = 16
 
static const uint32_t S34 = 23
 
static const uint32_t S41 = 6
 
static const uint32_t S42 = 10
 
static const uint32_t S43 = 15
 
static const uint32_t S44 = 21
 
static constexpr const unsigned char PADDING [64] = {0x80}
 

详细描述

MD5 算法类

成员类型定义说明

◆ InputStream

工具所用输入流

◆ OutputStream

工具所用输出流

成员函数说明

◆ encode() [1/4]

std::unique_ptr< char[]> MD5Util::encode ( const InputStream::Ptr & input,
bool is_cap = true )
staticnoexcept

生成 32 位大写 MD5 字符串

参数
input摘要来源
is_cap指示字符串字母是否大写
返回
返回生成的字符串,生成失败则为 nullptr

引用了 encode().

◆ encode() [2/4]

void MD5Util::encode ( const InputStream::Ptr & input,
const OutputStream::Ptr & output )
staticnoexcept

生成 MD5 信息

参数
input摘要来源
outputMD5 数据输出

引用了 encode().

被这些函数引用 sese::MessageDigest::digest() , 以及 sese::MessageDigest::digest().

◆ encode() [3/4]

std::unique_ptr< char[]> MD5Util::encode ( InputStream * input,
bool is_cap = true )
staticnoexcept

生成 32 位大写 MD5 字符串

参数
input摘要来源
is_cap指示字符串字母是否大写
返回
返回生成的字符串,生成失败则为 nullptr

引用了 encode(), sese::io::AbstractByteBuffer::read() , 以及 sese::MemoryViewer::toChar().

◆ encode() [4/4]

void MD5Util::encode ( InputStream * input,
OutputStream * output )
staticnoexcept

生成 MD5 信息

参数
input摘要来源
outputMD5 数据输出

单位为 位

执行完本次后不再执行

单位为 位

单位为 位

引用了 ToLittleEndian64() , 以及 transform().

◆ F()

uint32_t MD5Util::F ( uint32_t x,
uint32_t y,
uint32_t z )
inlinestaticprivatenoexcept

◆ FF()

uint32_t MD5Util::FF ( uint32_t a,
uint32_t b,
uint32_t c,
uint32_t d,
uint32_t x,
uint32_t s,
uint32_t t )
inlinestaticprivatenoexcept

引用了 a, b, c, d , 以及 LeftRotate.

◆ G()

uint32_t MD5Util::G ( uint32_t x,
uint32_t y,
uint32_t z )
inlinestaticprivatenoexcept

◆ GG()

uint32_t MD5Util::GG ( uint32_t a,
uint32_t b,
uint32_t c,
uint32_t d,
uint32_t x,
uint32_t s,
uint32_t t )
inlinestaticprivatenoexcept

引用了 a, b, c, d , 以及 LeftRotate.

◆ H()

uint32_t MD5Util::H ( uint32_t x,
uint32_t y,
uint32_t z )
inlinestaticprivatenoexcept

◆ HH()

uint32_t MD5Util::HH ( uint32_t a,
uint32_t b,
uint32_t c,
uint32_t d,
uint32_t x,
uint32_t s,
uint32_t t )
inlinestaticprivatenoexcept

引用了 a, b, c, d , 以及 LeftRotate.

◆ I()

uint32_t MD5Util::I ( uint32_t x,
uint32_t y,
uint32_t z )
inlinestaticprivatenoexcept

◆ II()

uint32_t MD5Util::II ( uint32_t a,
uint32_t b,
uint32_t c,
uint32_t d,
uint32_t x,
uint32_t s,
uint32_t t )
inlinestaticprivatenoexcept

引用了 a, b, c, d , 以及 LeftRotate.

◆ transform()

void MD5Util::transform ( uint32_t * res,
uint8_t * buffer )
staticprivatenoexcept

用于进行变换操作

引用了 a, b, c , 以及 d.

被这些函数引用 encode().

类成员变量说明

◆ A

const uint32_t sese::MD5Util::A = 0x67452301
staticprivate

◆ B

const uint32_t sese::MD5Util::B = 0xefcdab89
staticprivate

◆ C

const uint32_t sese::MD5Util::C = 0x98badcfe
staticprivate

◆ D

const uint32_t sese::MD5Util::D = 0x10325476
staticprivate

◆ PADDING

const unsigned char sese::MD5Util::PADDING[64] = {0x80}
staticconstexprprivate

◆ S11

const uint32_t sese::MD5Util::S11 = 7
staticprivate

◆ S12

const uint32_t sese::MD5Util::S12 = 12
staticprivate

◆ S13

const uint32_t sese::MD5Util::S13 = 17
staticprivate

◆ S14

const uint32_t sese::MD5Util::S14 = 22
staticprivate

◆ S21

const uint32_t sese::MD5Util::S21 = 5
staticprivate

◆ S22

const uint32_t sese::MD5Util::S22 = 9
staticprivate

◆ S23

const uint32_t sese::MD5Util::S23 = 14
staticprivate

◆ S24

const uint32_t sese::MD5Util::S24 = 20
staticprivate

◆ S31

const uint32_t sese::MD5Util::S31 = 4
staticprivate

◆ S32

const uint32_t sese::MD5Util::S32 = 11
staticprivate

◆ S33

const uint32_t sese::MD5Util::S33 = 16
staticprivate

◆ S34

const uint32_t sese::MD5Util::S34 = 23
staticprivate

◆ S41

const uint32_t sese::MD5Util::S41 = 6
staticprivate

◆ S42

const uint32_t sese::MD5Util::S42 = 10
staticprivate

◆ S43

const uint32_t sese::MD5Util::S43 = 15
staticprivate

◆ S44

const uint32_t sese::MD5Util::S44 = 21
staticprivate

该类的文档由以下文件生成: