md5是否可以分解为跨多个内核/线程运行? [英] Can md5 be broken up to run across multiple cores/threads?

查看:100
本文介绍了md5是否可以分解为跨多个内核/线程运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在计算大型文件的md5总和时,我发现单个cpu内核会花100%的时间跳到100%,而所有其他内核都保持空闲状态.

When calculating the md5 sum of large files, I see a single cpu core jump to 100% for however long it takes, leaving all other cores idle.

我对md5的基本了解是整个过程是完全线性的,其中值取决于所读取的所有先前值,我们无法做任何事情来使其成为多线程.这是真的吗?

My rudimentary understanding of md5 is the entire process is completely linear, where values are dependent on all previous values read, and there is nothing we can do to make it multi-threaded. Is this true?

或者有一种方法可以将文件分成多个部分,使用多核在多个部分上计算< something> ,然后将这些< something> 组合在一起值放入最终的md5中?

Or is there a way to break the files into sections, calculate <something> over multiple parts using multi-cores, and then combine those <something> values into the final md5?

我们用于计算md5sum的库为 http://libmd5-rfc.sourceforge.net/,但是如果可以跨多个内核打破md5sum,以便更快完成,我会改用另一种.

The library we're using to calculate the md5sum is http://libmd5-rfc.sourceforge.net/ but I'd switch to a different one if it was possible to break the md5sum across multiple cores so it completes faster.

(注意:更改为md5以外的其他内容不是问题,因为与该接口连接的其他封闭系统也无法实现.也不是有关使用md5的安全性的问题.)

(Note: changing to something other than md5 is not the question, nor can it be done because of the other closed systems to which this interfaces. Nor is this question about the safety of using md5.)

推荐答案

不,您不能在文件级别对其进行分解. MD5遍历数据时会保持状态.

No you cannot break it apart at the file level. MD5 maintains a state as it runs through the data.

这篇关于md5是否可以分解为跨多个内核/线程运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆