# Append

> Hash new input string and combine with the current hash value.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## Append(string)

Hash new input string and combine with the current hash value.

```csharp
public void Append(string data)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Input data string. Note that Unity interprets the string as UTF-8 data, even if internally in C# strings are UTF-16.

## Append\<T>(NativeArray\<T>)

Hash new input data array and combine with the current hash value.

```csharp
public void Append<T>(NativeArray<T> data) where T : struct
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): Input data array.

## Append\<T>(NativeArray\<T>, int, int)

Hash a slice of new input data array and combine with the current hash value.

```csharp
public void Append<T>(NativeArray<T> data, int start, int count) where T : struct
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): Input data array.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The first element in the data to start hashing from.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Number of array elements to hash.

## Append\<T>(\`\<>\[])

Hash new input data array and combine with the current hash value.

```csharp
public void Append<T>(T[] data) where T : struct
```

### Parameters

**** (\[\<T>\[]]\(./)): Input data array.

## Append\<T>(\`\<>\[], int, int)

Hash a slice of new input data array and combine with the current hash value.

```csharp
public void Append<T>(T[] data, int start, int count) where T : struct
```

### Parameters

**** (\[\<T>\[]]\(./)): Input data array.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The first element in the data to start hashing from.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Number of array elements to hash.

## Append\<T>(List\<T>)

Hash new input data array and combine with the current hash value.

```csharp
public void Append<T>(List<T> data) where T : struct
```

### Parameters

**** (\[List\<T>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): Input data array.

## Append\<T>(List\<T>, int, int)

Hash a slice of new input data array and combine with the current hash value.

```csharp
public void Append<T>(List<T> data, int start, int count) where T : struct
```

### Parameters

**** (\[List\<T>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): Input data array.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The first element in the data to start hashing from.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Number of array elements to hash.

## Append\<T>(T)

Hash new input data and combine with the current hash value.

```csharp
public void Append<T>(ref T val) where T : unmanaged
```

### Parameters

**** (T): Input value.

### Remarks

The value must be an "unmanaged" C# type. Primitive types like int, float, bool, enums, pointers, or structs containing primitive types are all unmanaged types. See [Unmanaged types](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/unmanaged-types) in C# language reference.

The int and float overloads use a dedicated code path that is optimized for 4-byte data sizes.

### Examples

```csharp
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    void Start()
    {
        var hash = new Hash128();
        hash.Append(42);
        hash.Append(13.0f);
        hash.Append("Hello");
        hash.Append(new int[] {1, 2, 3, 4, 5});
        // prints "2d6e582c3fcfb4b8f3c16650a75dc37b"
        Debug.Log(hash.ToString());
    }
}
```

## Append(int)

Hash new input data and combine with the current hash value.

```csharp
public void Append(int val)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Input value.

### Remarks

The value must be an "unmanaged" C# type. Primitive types like int, float, bool, enums, pointers, or structs containing primitive types are all unmanaged types. See [Unmanaged types](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/unmanaged-types) in C# language reference.

The int and float overloads use a dedicated code path that is optimized for 4-byte data sizes.

### Examples

```csharp
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    void Start()
    {
        var hash = new Hash128();
        hash.Append(42);
        hash.Append(13.0f);
        hash.Append("Hello");
        hash.Append(new int[] {1, 2, 3, 4, 5});
        // prints "2d6e582c3fcfb4b8f3c16650a75dc37b"
        Debug.Log(hash.ToString());
    }
}
```

## Append(float)

Hash new input data and combine with the current hash value.

```csharp
public void Append(float val)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Input value.

### Remarks

The value must be an "unmanaged" C# type. Primitive types like int, float, bool, enums, pointers, or structs containing primitive types are all unmanaged types. See [Unmanaged types](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/unmanaged-types) in C# language reference.

The int and float overloads use a dedicated code path that is optimized for 4-byte data sizes.

### Examples

```csharp
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    void Start()
    {
        var hash = new Hash128();
        hash.Append(42);
        hash.Append(13.0f);
        hash.Append("Hello");
        hash.Append(new int[] {1, 2, 3, 4, 5});
        // prints "2d6e582c3fcfb4b8f3c16650a75dc37b"
        Debug.Log(hash.ToString());
    }
}
```

## Append(void\*, ulong)

Hash new input data and combine with the current hash value.

```csharp
public void Append(void* data, ulong size)
```

### Parameters

**** (\[void\*]\(https\://learn.microsoft.com/dotnet/api/system.void)): Raw data pointer, usually used with C# stackalloc data.**** (\[ulong]\(https\://learn.microsoft.com/dotnet/api/system.uint64)): Data size in bytes.
