GithubHelp home page GithubHelp logo

eallegretta / assemblyhasher Goto Github PK

View Code? Open in Web Editor NEW

This project forked from benjamine/assemblyhasher

0.0 1.0 0.0 5.48 MB

Hash tool for .Net assemblies

License: MIT License

C# 91.81% PowerShell 8.19%

assemblyhasher's Introduction

AssemblyHasher

Hash tool for .Net assemblies

Usage

  AsemblyHasher.exe SomeLibrary.dll
  AsemblyHasher.exe SomeApp.exe

  # ignore AssemblVersion and AssemblyFileVersion 
  AsemblyHasher.exe --ignore-versions SomeLibrary.dll

  # hash multiple files at once
  AsemblyHasher.exe SomeLibrary.dll Another.dll A3rdone.dll

  # other files (not *.dll|exe) content gets hashed too
  AsemblyHasher.exe SomeLibrary.dll Picture.jpeg REAME.md

The output is a hash (using MurMur-128) of assembly contents (source code + embedded resources, which are extracted using an embedded copy of ildasm.exe).

Why

Why not hash the .dll/.exe file directly? Because every time an assembly is compiled a few always changing values are added (MVID, timestamp, Image Base, and many others) making the file content different on every compilation. This tool will disassemble and then remove those values before hashing.

There are many possible use cases, but my main motivation for this is using it in git-based deployments to keep a cleaner history and to avoid restarting the app when no dlls have changed (IIS hot deploy). For that purpose you can use the included powershell script GitResetUnmodifiedAssemblies.ps1.

Requirements

  • .Net Framework 4.5

Credits

  • Vasil Trifonov (@vtrifonov), idea and initial version published at this article
  • Benjamin Eidelman (@benjamine), packing/publishing, sha1, hashing embedded resources

assemblyhasher's People

Contributors

beneidel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.