Class HashingMethods
Creates the RawHash for an object.
Namespace: UnityEditor.Build.Pipeline.Utilities
Syntax
public static class HashingMethods : object
Methods
Calculate(Hash128, Hash128)
Creates the hash for a pair of Hash128 objects. Optimized specialization of the generic Calculate() methods that has been shown to be ~3x faster The generic function uses reflection to obtain the four 32bit fields in the Hash128 which is slow, this function uses more 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. |
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(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<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>(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. |
CalculateFile(String)
Creates the hash for a file.
Declaration
public static RawHash CalculateFile(string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| String | filePath | 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. |