<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Scanner/scanHexInt64(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSScanner(im)scanHexLongLong:"
  },
  "title" : "scanHexInt64(_:)"
}
-->

# scanHexInt64(_:)

Scans for a long long value from a hexadecimal representation, returning a found value by reference.

```
func scanHexInt64(_ result: UnsafeMutablePointer<UInt64>?) -> Bool
```

## Parameters

`result`

Upon return, contains the scanned value. Contains `HUGE_VAL` or `–HUGE_VAL` on overflow.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the receiver finds a valid hexadecimal long long representation, otherwise <doc://com.apple.documentation/documentation/Swift/false>. Overflow is considered a valid hexadecimal long long representation.

## Discussion

The hexadecimal integer representation may optionally be preceded by `0x` or `0X`. Skips past excess digits in the case of overflow, so the receiver’s position is past the entire hexadecimal representation.

Invoke this method with `NULL` as `result` to simply scan past a hexadecimal long long representation.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)