Methods (4) Properties (1)
Namespace: SchwabenCode.QuickIO

Syntax

public class QuickIOHashResult

Summary

This class is used for hash calculations. Use for human readable output.

Example

// Show human readable hash
QuickIOHashResult hashResult = QuickIOFile.CalculateSha256Hash( "C:\temp\image.bin" );
Console.WriteLine("Hash: {0}", hashResult.Format( Encoding.UTF8, "x2" );

Methods

QuickIOHashResult(Byte[] hashBytes)

Creates an instance of QuickIOHashResult

internal void QuickIOHashResult(Byte[] hashBytes)

Parameters

hashBytes

Byte[]

Format()

Formats the HashBytes as a hexadecimal string using UTF8 encoding.

public String Format()

Returns

Formated string

Example

// Show human readable hash
QuickIOHashResult hashResult = QuickIOFile.CalculateSha256Hash( "C:\temp\image.bin" );
Console.WriteLine("Hash: {0}", hashResult.Format( );

Format(Encoding encoding)

Formats the HashBytes as a hexadecimal string using specified encoding.

public String Format(Encoding encoding)

Parameters

encoding

Encoding

Encoding for formatting

Returns

Formated string

Example

// Show human readable hash
QuickIOHashResult hashResult = QuickIOFile.CalculateSha256Hash( "C:\temp\image.bin" );
Console.WriteLine("Hash: {0}", hashResult.Format( Encoding.UTF8 );

Format(Encoding encoding, String format)

Formats the HashBytes using specified encoding and format.

public String Format(Encoding encoding, String format)

Parameters

encoding

Encoding

Encoding for formatting

format

String

Pattern for formatting. Use x2 for hexadecimal output.

Returns

Formated string

Example

// Show human readable hash
QuickIOHashResult hashResult = QuickIOFile.CalculateSha256Hash( "C:\temp\image.bin" );
Console.WriteLine("Hash: {0}", hashResult.Format( Encoding.UTF8, "x2" );

Properties

HashBytes

The bytes that represents the calculation result

public Byte[] HashBytes { get; set; }

Classdiagram

save

reset

Drag to pan - Use Mousewheel + Ctrl to zoom