a function that converts a key into an array index. This is exactly how Python's `dict` works behind the scenes.