# `GSPath nodeIndexForHash:callback:`

*Instance Method*

Enumerates matching node positions for a geometric hash.

## Declaration

```swift
func nodeIndex(for hash: GSPathHash, callback callbackBlock: @escaping (Int, CGFloat, NSPoint, UnsafeMutablePointer<ObjCBool>) -> Void)
```

```objc
- (void) nodeIndexForHash:(GSPathHash *) hash callback:(void (^)(NSInteger nodeIdx, CGFloat averageAngle, NSPoint averagePos, BOOL *stop)) callbackBlock;
```

```python
nodeIndexForHash_callback_(hash: GSPathHash, nodeIdx: int, averageAngle: float, averagePos: NSPoint, stop: bool, callbackBlock)
```

## Discussion

The callback receives the matching node index, the average angle, and the average position. Set `stop` to `YES` in the callback to stop enumeration.

## See Also

### Equality and Comparison

- [`GSPath isEqualToPath:`](/Core/GlyphsCore/GSPath/isEqualToPath:) — Whether another path has the same closed state, node count, and node positions.
- [`GSPath compareHash`](/Core/GlyphsCore/GSPath/compareHash) — A geometric hash for matching paths with the same node structure.
- [`GSPath transformForHash:`](/Core/GlyphsCore/GSPath/transformForHash:) — A transform that maps a geometric hash to the matching position on the path.

