XE8 hash
c++builder xe8 hash calc
md5、sha256、sha384、sha512
file and string
sha256、sha384、sha512 must call load function .
system function not use any third party component.
- New in XE8! New System.Hash RTL unit, with hash functions to support the new HTTP framework
Caption:= System.Hash.THashMD5.GetHashString('ww');
id...
IdHashMessageDigest.pas
Idsslopensslheaders::Load(); //string
void __fastcall TFrmEncrypt::btnHashStringAsHexClick(TObject *Sender)
{ String instr = LabeledEdit1->Text;
TIdHashMessageDigest5 *md5 = new TIdHashMessageDigest5();
LabeledEdit2->Text = md5->HashStringAsHex(instr);
delete md5; TIdHashCRC32 *crc = new TIdHashCRC32();
LabeledEdit3->Text = crc->HashStringAsHex(instr);
delete crc; TIdHashSHA1 *sha1 = new TIdHashSHA1();
LabeledEdit4->Text = sha1->HashStringAsHex(instr);
delete sha1; TIdHashSHA224 *sha224 = new TIdHashSHA224();
LabeledEdit5->Text = sha224->HashStringAsHex(instr);
delete sha224; TIdHashSHA256 *sha256 = new TIdHashSHA256();
bool bf = sha256->IsAvailable();
LabeledEdit6->Text = sha256->HashStringAsHex(instr);
delete sha256; TIdHashSHA384 *sha384 = new TIdHashSHA384();
LabeledEdit7->Text = sha384->HashStringAsHex(instr);
delete sha384; TIdHashSHA512 *sha512 = new TIdHashSHA512();
LabeledEdit8->Text = sha512->HashStringAsHex(instr);
delete sha512;
} //stream
void __fastcall TFrmEncrypt::btnCalcClick(TObject *Sender)
{
String fileName(LabeledEdit1->Text);
TFileStream *fs;
fs = new TFileStream(fileName, fmOpenRead | fmShareDenyWrite); TIdHashMessageDigest5 *md5 = new TIdHashMessageDigest5();
LabeledEdit2->Text = md5->HashStreamAsHex(fs);
delete md5; const __int64 Istep = ;
fs->Seek(Istep, soBeginning);
TIdHashCRC32 *crc = new TIdHashCRC32();
LabeledEdit3->Text = crc->HashStreamAsHex(fs);
delete crc; fs->Seek(Istep, soBeginning);
TIdHashSHA1 *sha1 = new TIdHashSHA1();
LabeledEdit4->Text = sha1->HashStreamAsHex(fs);
delete sha1; fs->Seek(Istep, soBeginning);
TIdHashSHA224 *sha224 = new TIdHashSHA224();
LabeledEdit5->Text = sha224->HashStreamAsHex(fs);
delete sha224; fs->Seek(Istep, soBeginning);
TIdHashSHA256 *sha256 = new TIdHashSHA256();
LabeledEdit6->Text = sha256->HashStreamAsHex(fs);
delete sha256; fs->Seek(Istep, soBeginning);
TIdHashSHA384 *sha384 = new TIdHashSHA384();
LabeledEdit7->Text = sha384->HashStreamAsHex(fs);
delete sha384; fs->Seek(Istep, soBeginning);
TIdHashSHA512 *sha512 = new TIdHashSHA512();
LabeledEdit8->Text = sha512->HashStreamAsHex(fs);
delete sha512; delete fs;
} Idsslopensslheaders::Unload();
XE8 hash的更多相关文章
- python连接redis、redis字符串操作、hash操作、列表操作、其他通用操作、管道、django中使用redis
今日内容概要 python连接redis redis字符串操作 redis之hash操作 redis之列表操作 redis其他 通用操作,管道 django中使用redis 内容详细 1.python ...
- 复杂的 Hash 函数组合有意义吗?
很久以前看到一篇文章,讲某个大网站储存用户口令时,会经过十分复杂的处理.怎么个复杂记不得了,大概就是先 Hash,结果加上一些特殊字符再 Hash,结果再加上些字符.再倒序.再怎么怎么的.再 Hash ...
- 对抗密码破解 —— Web 前端慢 Hash
(更新:https://www.cnblogs.com/index-html/p/frontend_kdf.html ) 0x00 前言 天下武功,唯快不破.但在密码学中则不同.算法越快,越容易破. ...
- 散列表(hash table)——算法导论(13)
1. 引言 许多应用都需要动态集合结构,它至少需要支持Insert,search和delete字典操作.散列表(hash table)是实现字典操作的一种有效的数据结构. 2. 直接寻址表 在介绍散列 ...
- hash表长度优化证明
hash表冲突的解决方法一般有两个方向: 一个是倾向于空间换时间,使用向量加链表可以最大程度的在节省空间的前提下解决冲突. 另外一个倾向于时间换空间,下面是关于这种思路的一种合适表长度的证明过程: 这 ...
- SQL Server-聚焦查询计划Stream Aggregate VS Hash Match Aggregate(二十)
前言 之前系列中在查询计划中一直出现Stream Aggregate,当时也只是做了基本了解,对于查询计划中出现的操作,我们都需要去详细研究下,只有这样才能对查询计划执行的每一步操作都了如指掌,所以才 ...
- C# salt+hash 加密
一.先明确几个基本概念 1.伪随机数:pseudo-random number generators ,简称为:PRNGs,是计算机利用一定的算法来产生的.伪随机数并不是假随机 数,这里的" ...
- SQL 提示介绍 hash/merge/concat union
查询提示一直是个很有争议的东西,因为他影响了sql server 自己选择执行计划.很多人在问是否应该使用查询提示的时候一般会被告知慎用或不要使用...但是个人认为善用提示在不修改语句的条件下,是常用 ...
- 对一致性Hash算法,Java代码实现的深入研究
一致性Hash算法 关于一致性Hash算法,在我之前的博文中已经有多次提到了,MemCache超详细解读一文中"一致性Hash算法"部分,对于为什么要使用一致性Hash算法.一致性 ...
随机推荐
- Hook入门
Hook入门 2014-07-24 基本概念 Windows消息机制 Hook(钩子) 运行机制 核心函数 C# hook示例 基本概念[1] Windows消息机制[5] Windows操作系统是建 ...
- mongoDB使用复制还原数据库节省空间
用db.copyDatabase可以备份复制数据的方法. 1.db.copyDatabase("from","to","127.0.0.1:16161 ...
- 在DirectX 中进行2D渲染
http://flcstudio.blog.163.com/blog/static/756035392008115111123672/ 最近,我看到很多关于DirectX8在最新的API中摒弃Dire ...
- 【温故知新】c#异步编程模型(APM)--使用委托进行异步编程
当我们用到C#类许多耗时的函数XXX时,总会存在同名的类似BeginXXX,EndXXX这样的函数. 例如Stream抽象类的Read函数就有 public abstract int Read(byt ...
- UTC的相互转换(java)
SimpleDateFormat foo = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); System.out.println(& ...
- BZOJ 3694 最短路
233333想简单了.... 题解参见http://hzwer.com/3710.html #include<iostream> #include<cstdio> #inclu ...
- BZOJ 4004 装备购买
md有毒卡什么精度!!!! 最大线性无关组(线性基)可作为模板. #include<iostream> #include<cstdio> #include<cstring ...
- 旧书重温:0day2【1】 简单的缓冲区溢出案例
0x01 准备: VMwarePlayer (我是在360软件管家那搜到的下载的) xp sp2 http://user.qzone.qq.com/252738331/blog/1357138598 ...
- HDU 1599 find the mincost route (无向图的最小环)
题意: 给一个带权无向图,求其至少有3个点组成的环的最小权之和. 思路: (1)DFS可以做,实现了确实可以,只是TLE了.量少的时候应该还是可以水一下的.主要思路就是,深搜过程如果当前点搜到一个点访 ...
- fmri分析工具:spm里的统计学 Introduction to SPM statistics
引言 Introduction 需要特别说明,spm是每一个体素为单位,计算统计量,进行t检验. 1.分别在每个体素上做方差分析; 2.对每个体素的方差分析结果,计算t检验统计量; 3.计算等同于t ...