DirectoryFingerPrinting.Library 1.1.0-beta

This is a prerelease version of DirectoryFingerPrinting.Library.
dotnet add package DirectoryFingerPrinting.Library --version 1.1.0-beta
NuGet\Install-Package DirectoryFingerPrinting.Library -Version 1.1.0-beta
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DirectoryFingerPrinting.Library" Version="1.1.0-beta" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DirectoryFingerPrinting.Library --version 1.1.0-beta
#r "nuget: DirectoryFingerPrinting.Library, 1.1.0-beta"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DirectoryFingerPrinting.Library as a Cake Addin
#addin nuget:?package=DirectoryFingerPrinting.Library&version=1.1.0-beta&prerelease

// Install DirectoryFingerPrinting.Library as a Cake Tool
#tool nuget:?package=DirectoryFingerPrinting.Library&version=1.1.0-beta&prerelease

logo

License: GPL v3 Release NuGet

This is the english documentation. Following translations are available:

DirectoryFingerPrinting.Library

DirectoryFingerPrinting.Library (short: DFP lib) is a powerful .NET/C# library designed for creating and collecting file and directory checksums and metadatas, for forensic, version or change management tasks.

Purpose: This library offers types and methods for retrieving all or specific (configurable) differences between the files in two directories. Save the current state (meta-data of whole files) of a directory as a tiny DFP file, later you can compare the content of the directory against the DFP file and so recognize if there were any changes, and if so what has been changed in that directory.

The DFP library offers a comprehensive set of features, including:

  • Retrieving metadata such as checksum, creation date, last modification date, and size for files in a directory and subdirectories (recursive).
  • Calculating checksums (hashes) for all files within a directory.
  • Comparing and detecting changes between two directories or fingerprint files.

Key Features

  • Obtain file metadata: Access creation dates, modification dates, sizes, and more.
  • Calculate checksums: Generate hash values (e.g., SHA-1) for files within a directory.
  • Identify changes: Detect additions, removals, and modifications to files.
  • Efficient file comparisons: Quickly compare and report differences between directories.
  • Selectable hashing algorithms: CRC32, MD5, SHA1, SHA256, SHA512

UML class diagramm

UML class diagram

Demonstration code

public void Demo()
{
   // Create settings:
   IOptions options = new Options
   {
         UseHashsum = true,
         UseSize = true,
         UseVersion = true,
         UseLastModification = true,
         HashAlgo = EHashAlgo.SHA512,
         // More options...
   };

   // Create metadata factory:
   IMetaDataFactory metaDataFactory = new MetaDataFactory(options);

   // Get the metadata for a single file:
   IMetaData metaData1 = metaDataFactory.CreateMetaData(@"C:\dir\filePath.ext");
   IMetaData metaData2 = metaDataFactory.CreateMetaData(new FileInfo(@"C:\dir\filePath.ext"));

   // Get the metadata for files in a directory:
   IEnumerable<IMetaData> metaDatasB = metaDataFactory.CreateMetaDatas(@"C:\dirPath");
   IEnumerable<IMetaData> metaDatasA = metaDataFactory.CreateMetaDatas(new DirectoryInfo(@"C:\dirPath"));

   // Create differencies-calculator factory:
   IDirDiffCalculator diffCalculator = new DirDiffCalculator(options);

   // Get file differencies between files in A and B:
   IEnumerable<IFileDiff> differences1 = diffCalculator.GetFileDifferencies(metaDatasA, metaDatasB);

   // Get file differencies between two DFP (files):
   IDirectoryFingerprint dfpA = null;
   IDirectoryFingerprint dfpB = null;
   // Load/convert dfp A...
   // Load/convert dfp B...

   // Get file differencies between dfpA and dfpB:
   IEnumerable<IFileDiff> differences2 = diffCalculator.GetFileDifferencies(dfpA, dfpB);

   // Show or save differences2...
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DirectoryFingerPrinting.Library:

Package Downloads
DirectoryFingerPrinting.CLI.Library

This library provides types and methods for parsing arguments, comparing two file-metadata, exporting reports in CSV, JSON or XML, help text etc., which are used by the cli application "dpf.exe" which you can find in my other repository "DirectoryFingerPrinting.CLI".

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0-beta 58 3/31/2024
1.1.0-alpha 46 3/31/2024

Beta Version 1.1.0-beta