Class HashingMethods
Creates the RawHash for an object.
Inherited Members
Namespace: UnityEditor.Build.Pipeline.Utilities
Assembly: Unity.ScriptableBuildPipeline.Editor.dll
Syntax
public static class HashingMethods
Methods
Calculate(object)
Creates the hash for an object.
Declaration
public static RawHash Calculate(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object. |
Returns
| Type | Description |
|---|---|
| RawHash | Returns the hash of the object. |
Calculate(params object[])
Creates the hash for a set of objects.
Declaration
public static RawHash Calculate(params object[] objects)
Parameters
| Type | Name | Description |
|---|---|---|
| object[] | objects | The objects. |
Returns
| Type | Description |
|---|---|
| RawHash | Returns the hash of the set of objects. |
Calculate(Hash128, int)
Creates the hash for a Hash128 and int value. Optimized specialization of the generic Calculate() methods that has been shown to be ~3x faster. Produces identical output to Calculate(new object[] { hash, value }).
Declaration
public static RawHash Calculate(Hash128 hash, int value)
Parameters
| Type | Name | Description |
|---|---|---|
| Hash128 | hash | The hash to combine |
| int | value | The int value to combine |
Returns
| Type | Description |
|---|---|
| RawHash | Returns the combined hash. |
Calculate(Hash128, Hash128)
Creates the hash for a pair of Hash128 objects. Optimized specialization of the generic Calculate() that uses direct byte access.
Declaration
public static RawHash Calculate(Hash128 hash1, Hash128 hash2)
Parameters
| Type | Name | Description |
|---|---|---|
| Hash128 | hash1 | The first hash to combine |
| Hash128 | hash2 | The second hash to combine |
Returns
| Type | Description |
|---|---|
| RawHash | Returns the combined hash of the two hashes. |
CalculateFile(string)
Creates the hash for a file.
Declaration
public static RawHash CalculateFile(string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filename | The file path. |
Returns
| Type | Description |
|---|---|
| RawHash | Returns the hash of the file. |
CalculateFile<T>(string)
Creates the hash for a file.
Declaration
public static RawHash CalculateFile<T>(string filePath) where T : HashAlgorithm
Parameters
| Type | Name | Description |
|---|---|---|
| string | filePath | The file path. |
Returns
| Type | Description |
|---|---|
| RawHash | Returns the hash of the file. |
Type Parameters
| Name | Description |
|---|---|
| T | The hash algorithm type. |
CalculateStream(Stream)
Creates the hash for a stream of data.
Declaration
public static RawHash CalculateStream(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream of data. |
Returns
| Type | Description |
|---|---|
| RawHash | Returns the hash of the stream. |
CalculateStream<T>(Stream)
Creates the hash for a stream of data.
Declaration
public static RawHash CalculateStream<T>(Stream stream) where T : HashAlgorithm
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream of data. |
Returns
| Type | Description |
|---|---|
| RawHash | Returns the hash of the stream. |
Type Parameters
| Name | Description |
|---|---|
| T | The hash algorithm type. |
Calculate<T>(object)
Creates the hash for an object.
Declaration
public static RawHash Calculate<T>(object obj) where T : HashAlgorithm
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object. |
Returns
| Type | Description |
|---|---|
| RawHash | Returns the hash of the object. |
Type Parameters
| Name | Description |
|---|---|
| T | The hash algorithm type. |
Calculate<T>(params object[])
Creates the hash for a set of objects.
Declaration
public static RawHash Calculate<T>(params object[] objects) where T : HashAlgorithm
Parameters
| Type | Name | Description |
|---|---|---|
| object[] | objects | The objects. |
Returns
| Type | Description |
|---|---|
| RawHash | Returns the hash of the set of objects. |
Type Parameters
| Name | Description |
|---|---|
| T | The hash algorithm type. |