Skip to content

Instantly share code, notes, and snippets.

View speaktech-account's full-sized avatar

speaktech speaktech-account

View GitHub Profile
@seanbamforth
seanbamforth / AmazonEtagHashForFile.ps1
Last active September 21, 2023 13:48
Calculate Amazon eTag hash for named file. Powershell
#Calculates an eTag for a local file that should match the S3 eTag of the uploaded file.
$md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
$blocksize = (1024*1024*5)
$startblocks = (1024*1024*16)
function AmazonEtagHashForFile($filename) {
$lines = 0
[byte[]] $binHash = @()