> For the complete documentation index, see [llms.txt](https://wiki.redmodding.org/scripting-cyberpunk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.redmodding.org/scripting-cyberpunk/redscript/common-patterns/hash-maps.md).

# Hash maps

There are 4 general purpose hash map implementations:

* [`inkHashMap`](https://nativedb.red4ext.com/inkScriptHashMap): `Uint64 -> ref<IScriptable>`
* [`inkWeakHashMap`](https://nativedb.red4ext.com/inkScriptWeakHashMap): `Uint64 -> wref<IScriptable>`
* [`inkIntHashMap`](https://nativedb.red4ext.com/inkScriptIntHashMap): `Uint64 -> Int32`
* [`inkStringMap`](https://nativedb.red4ext.com/inkScriptStringMap): `String -> Uint64`

For `inkHashMap` and `inkWeakHashMap`, all custom classes extend `IScriptable,` therefore they can be used as values in these hash maps.

```swift
let map = new inkHashMap();
hashMap.Insert(TDBID.ToNumber(t"key1"), MyClass.Create(1));
hashMap.Insert(TDBID.ToNumber(t"key2"), MyClass.Create(2));

let value: ref<MyClass> = map.Get(TDBID.ToNumber(t"key1")) as MyClass;
```
