---
title: "NSSwapLongLong(_:)"
framework: foundation
role: symbol
role_heading: Function
path: "foundation/nsswaplonglong(_:)"
---

# NSSwapLongLong(_:)

Swaps the bytes of a number.

## Declaration

```swift
func NSSwapLongLong(_ inv: UInt64) -> UInt64
```

## Discussion

Discussion Swaps the bytes of inv and returns the resulting value. Bytes are swapped from each low-order position to the corresponding high-order position and vice versa. For example, if the bytes of inv are numbered from 1 to 8, this function swaps bytes 1 and 8, bytes 2 and 7, bytes 3 and 6, and bytes 4 and 5.

## See Also

### Related Documentation

- [NSSwapLong(_:)](foundation/nsswaplong(_:).md)
- [NSSwapDouble(_:)](foundation/nsswapdouble(_:).md)

### Functions

- [NSConvertHostDoubleToSwapped(_:)](foundation/nsconverthostdoubletoswapped(_:).md)
- [NSConvertHostFloatToSwapped(_:)](foundation/nsconverthostfloattoswapped(_:).md)
- [NSConvertSwappedDoubleToHost(_:)](foundation/nsconvertswappeddoubletohost(_:).md)
- [NSConvertSwappedFloatToHost(_:)](foundation/nsconvertswappedfloattohost(_:).md)
- [NSHostByteOrder()](foundation/nshostbyteorder().md)
- [NSSwapBigDoubleToHost(_:)](foundation/nsswapbigdoubletohost(_:).md)
- [NSSwapBigFloatToHost(_:)](foundation/nsswapbigfloattohost(_:).md)
- [NSSwapBigIntToHost(_:)](foundation/nsswapbiginttohost(_:).md)
- [NSSwapBigLongLongToHost(_:)](foundation/nsswapbiglonglongtohost(_:).md)
- [NSSwapBigLongToHost(_:)](foundation/nsswapbiglongtohost(_:).md)
- [NSSwapBigShortToHost(_:)](foundation/nsswapbigshorttohost(_:).md)
- [NSSwapDouble(_:)](foundation/nsswapdouble(_:).md)
- [NSSwapFloat(_:)](foundation/nsswapfloat(_:).md)
- [NSSwapHostDoubleToBig(_:)](foundation/nsswaphostdoubletobig(_:).md)
- [NSSwapHostDoubleToLittle(_:)](foundation/nsswaphostdoubletolittle(_:).md)
