md5

Powershell Speed: How to speed up ForEach-Object MD5/hash check

感情迁移 提交于 2021-01-27 07:22:26
问题 I'm running the following MD5 check on 500 million files to check for duplicates. The scripts taking forever to run and I was wondering how to speed it up. How could I speed it up? Could I use a try catch loop instead of contains to throw an error when the hash already exists instead? What would you all recommend? $folder = Read-Host -Prompt 'Enter a folder path' $hash = @{} $lineCheck = 0 Get-ChildItem $folder -Recurse | where {! $_.PSIsContainer} | ForEach-Object { $lineCheck++ Write-Host

Time complexity of MD5

爷,独闯天下 提交于 2020-12-30 09:55:37
问题 What is the time complexity of the MD5 algorithm? I couldn't find a definitive answer online. I think the complexity is O(n) but I'm not really sure. 回答1: O(n) as mentioned by DuBuisson and osgx in the comments. 来源: https://stackoverflow.com/questions/43625569/time-complexity-of-md5