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

Check a List of Servers to Find Currently Stopped Autorun Services

$username = (Get-ADDomain).name+'\USERNAME' $Password = 'PASSWORD' $pass = ConvertTo-SecureString -AsPlainText $Password -Force $cred = New-Object…

PowerShell: Set ACL

# setAcl-v0.01.ps1# # What this script does:# 1. Set permissions on a set of "destination…

PowerShell: Windows Automated Disk Cleanup

##################################################################################     <#      This script is created to automate the cleanup activity. Doing so will benefit to reduce the size of disk.     This script will perform the following   1. Clear windows temp and user temp folder   2. Empty recycle bin   3. Disk Cleanup   4. Clear CBS cabinet log files   5. Clear downloaded patches   6. Clear downloaded driver   7. Clean download folder      Note:  …
Other project: DragonCoin.com