Posted On February 4, 2020

PowerShell: An Exercise in Calculating Checksums

kimconnect 0 comments
blog.KimConnect.com >> Codes >> PowerShell: An Exercise in Calculating Checksums
$out = new-object byte[] 1073741824; #1GB
(new-object Random).NextBytes($out);
[IO.File]::WriteAllBytes($dummyFile, $out);

Measure-command{$hash=jacksum -a crc8 -x $dummyFile}
write-host $hash

# New Server
PS C:\Windows\system32> measure-command{$hash=jacksum -a crc8 -x $dummyFile}
Days : 0
Hours : 0
Minutes : 0
Seconds : 4
Milliseconds : 140
Ticks : 41406433
TotalDays : 4.79241122685185E-05
TotalHours : 0.00115017869444444
TotalMinutes : 0.0690107216666667
TotalSeconds : 4.1406433
TotalMilliseconds : 4140.6433
PS C:\Windows\system32> write-host $hash
eb 1073741824 D:\Test\dummyFile.txt

# Old Server
Days : 0
Hours : 0
Minutes : 0
Seconds : 3
Milliseconds : 725
Ticks : 37256354
TotalDays : 4.31207800925926E-05
TotalHours : 0.00103489872222222
TotalMinutes : 0.0620939233333333
TotalSeconds : 3.7256354
TotalMilliseconds : 3725.6354
PS C:\Users\176233> write-host $hash
a3 1073741824 E:\Test\dummyFile.txt

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell Script to Copy Members of One Group to Another

#Author: Kim Doan#Please tell me this code suck so that I can improve # Adding…

PowerShell: Methods to Download Files

# Change these values to reflect your desired downloads$fileURL = "https://download.microsoft.com/download/0/d/9/0d9d81cf-4ef2-4aa5-8cea-95a935ee09c9/PortQryV2.exe"$output = "C:\WINDOWS\System32\SysInternals\portqry.exe"1. Start-BitsTransfer (my…

How To Increase WordPress Memory Limit

It's are lesser known fact that WordPress overrides PHP's memory_limit settings. Thus, it is possible…