# ID struct

Namespace: [GH_IO.Serialization](https://developer.rhino3d.com/api/gh1/namespace/gh-io.serialization.md) · Assembly: [GH_IO](https://developer.rhino3d.com/api/gh1/assembly/gh-io.md)

```cs
public struct ID : IComparable<ID>, IEquatable<ID>
```

An ID is used to uniquely identify a specific item.

## Constructors

- [ID](https://developer.rhino3d.com/api/gh1/type/gh-io.serialization.id/ctor.md): (2 overloads) Constructor for IDs.

## Properties

- [Hash](https://developer.rhino3d.com/api/gh1/type/gh-io.serialization.id/hash.md): Gets the hash code.
- [HasIndex](https://developer.rhino3d.com/api/gh1/type/gh-io.serialization.id/hasindex.md): Gets whether the index has been set.
- [HasName](https://developer.rhino3d.com/api/gh1/type/gh-io.serialization.id/hasname.md): Gets whether the name has been set. Every valid ID must have a name.
- [Index](https://developer.rhino3d.com/api/gh1/type/gh-io.serialization.id/index.md): Gets the index of this ID, if there is no valid index then -1 is returned.
- [Name](https://developer.rhino3d.com/api/gh1/type/gh-io.serialization.id/name.md): Gets the name of this ID.

## Methods

- [CompareTo](https://developer.rhino3d.com/api/gh1/type/gh-io.serialization.id/compareto.md): Compares this ID to another ID.
- [Equals](https://developer.rhino3d.com/api/gh1/type/gh-io.serialization.id/equals.md): Determines if two IDs are equal.
- [GetHashCode](https://developer.rhino3d.com/api/gh1/type/gh-io.serialization.id/gethashcode.md): Gets the hash code.
- [ToString](https://developer.rhino3d.com/api/gh1/type/gh-io.serialization.id/tostring.md): Gets a string representation for this ID.
