我正在做关于MD5碰撞的演讲,我想让人们知道碰撞的可能性.
最好有两个文本块对同一个东西进行哈希处理,并解释在碰撞之前需要多少[a-zA-Z]组合.
显而易见的答案是哈希每个可能的组合,直到两个哈希相同.那么你将如何编写这个呢?作为一个快速实验,我尝试散列5列[AZ]的每个组合,将其存储在.net哈希表中并捕获碰撞异常.这有两个问题 - 哈希表最终超时,我很确定我需要更多的字符.
显然这个数据结构太大而无法在内存中处理,所以现在我必须要涉及一个数据库.听起来像是一个测试天蓝色的好项目 - 有点像这些家伙.
有人能指出我这样做的有效方法吗?
是否有任何C#方法与Convert.ToBase64String类似,但除了字母数字输出外不生成任何内容?
谢谢!
输出如下所示在output.txt文件中恢复:
array (
'IMType' => '1',
'Email' => 'test@gmail.com',
'SignupName' => 'test11',
'Password' => '11111',
'Encrypted' => '',
'Confirm' => '11111',
'OldPassword' => '',
'Name' => 'test',
'SignupProvinceText' => 'province',
'SignupCity' => 'cityname',
'Street' => 'street x.y',
'SignupIndustry' => 'IT',
'SignupCompany' => 'jobirn',
'SignupJt' => 'engineer',
'CellPhoneNum' => '',
'linked_in' => '',
)
Run Code Online (Sandbox Code Playgroud)
它实际上是输出var_export(my_variable,true),但如何再次将其读入变量?
我写自己的高斯滤波器,但它真的很慢.
OpenCV的高斯算法比我的高斯滤波器快20倍.我想在我的项目中重写OpenCV的高斯算法,我不想在我的项目中包含opencv.
然而,
任何人都可以给我算法描述,opencv的源代码似乎太难理解了吗?
我正在尝试使用Perl中的正则表达式进行搜索和替换.
我要搜索的文字是:
<space>Number<space>NumberNumberNumber
Run Code Online (Sandbox Code Playgroud)
我想用以下代替:
<space>Number<space>NumberNumberNumberI
Run Code Online (Sandbox Code Playgroud)
我有以下正则表达式,可用于查找字符串:
\s[0-9]\s[0-9[0-9][0-9]
Run Code Online (Sandbox Code Playgroud)
但是如何更换字符串呢?基本上我只是想在最后附加一个'I'.
我正在使用:
perl -pi -e "s/\s[0-9]\s[0-9][0-9][0-9]/I/;" testFile
Run Code Online (Sandbox Code Playgroud)
但这是用我取代整个事物而不是追加它.
我有一个经典的asp应用程序需要将XML发布到支付引擎,参考代码使用System.Net.HttpWebRequest对象(asp.net).我可以使用经典ASP中的等价物来发布XML吗?
我试图在我的asp.net网站上使用elmah,但每当我尝试访问http:// localhost:port/elmah.axd时,我都会找到资源未找到异常.我的web.config如下所示.
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="elmah">
<section name="security" requirePermission="false"
type="Elmah.SecuritySectionHandler, Elmah"/>
<section name="errorLog" requirePermission="false"
type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false"
type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false"
type="Elmah.ErrorFilterSectionHandler, Elmah"/>
</sectionGroup>
</configSections>
<elmah>
<security allowRemoteAccess="0" />
<errorLog type="Elmah.SqlErrorLog, Elmah"
connectionStringName="elmah-sql" />
<errorMail
from="my@account"
to="myself"
subject="ERROR From Elmah:"
async="true"
smtpPort="587"
smtpServer="smtp.gmail.com"
userName="my@account"
password="mypassword" />
</elmah>
<connectionStrings>
<add name="elmah-sql" connectionString="data source=(sqlserver);
database=elmahdb;
integrated security=false;User ID=user;Password=password"/>
</connectionStrings>
<system.web>
<compilation debug="true">
<assemblies>
<add assembly="Elmah, Version=1.0.10617.0, Culture=neutral,
PublicKeyToken=null"/>
</assemblies>
</compilation>
<authentication mode="Windows"/>
<httpHandlers> …Run Code Online (Sandbox Code Playgroud) 通过ajax加载内部div(#book_table)之后,我想调整主体的宽度以适应更大的内容.
var new_width = parseInt($('#book_table').css('width'))+407;
$('body').width(new_width);
Run Code Online (Sandbox Code Playgroud)
适用于FF和Safari,但在IE中使用"无效参数"失败.在解压缩的jQuery 1.3.1中,它是第1049行:
elem[ name ] = value;
Run Code Online (Sandbox Code Playgroud)
但是,传递文字值可以在IE中使用:
$('body').width(1200);
Run Code Online (Sandbox Code Playgroud) 我目前有一个超过600万行的数据库,并且还在增长.我目前做SELECT COUNT(id)FROM table; 为了向我的用户显示该号码,但数据库变得越来越大,除了能够显示该号码之外,我不需要存储所有这些行.有没有办法选择要显示的auto_increment值,以便我可以清除数据库中的大多数行?使用LAST_INSERT_ID()似乎不起作用.
我有一个程序,需要检查文件的大块是否归零或有数据.这个alg运行整个文件的大小达到几个演出并需要一段时间才能运行.有没有更好的方法来检查它是否归零?
平台:Linux和Windows
bool WGTController::isBlockCompleted(wgBlock* block)
{
if (!block)
return false;
uint32 bufSize = (uint32)block->size;
uint64 fileSize = UTIL::FS::UTIL_getFileSize(m_szFile);
if (fileSize < (block->size + block->fileOffset))
return false;
char* buffer = new char[bufSize];
FHANDLE fh=NULL;
try
{
fh = UTIL::FS::UTIL_openFile(m_szFile, UTIL::FS::FILE_READ);
UTIL::FS::UTIL_seekFile(fh, block->fileOffset);
UTIL::FS::UTIL_readFile(fh, buffer, bufSize);
UTIL::FS::UTIL_closeFile(fh);
}
catch (gcException &)
{
SAFE_DELETEA(buffer);
UTIL::FS::UTIL_closeFile(fh);
return false;
}
bool res = false;
for (uint32 x=0; x<bufSize; x++)
{
if (buffer[x] != 0)
{
res = true;
break;
}
}
SAFE_DELETEA(buffer);
return res;
}
Run Code Online (Sandbox Code Playgroud)