Files
luma/Sources/LumaCore/Models/AgentAddress.swift
Ole André Vadla Ravnås 25a20e140f Rename Utilities.swift to proper file names
Split into LumaCoreError.swift and AgentAddress.swift.
2026-04-06 19:35:44 +02:00

14 lines
393 B
Swift

import Foundation
public func parseAgentHexAddress(_ s: String) throws -> UInt64 {
guard s.hasPrefix("0x") else {
throw LumaCoreError.invalidArgument("Invalid address string from agent: '\(s)'")
}
guard let value = UInt64(s.dropFirst(2), radix: 16) else {
throw LumaCoreError.invalidArgument("Invalid address string from agent: '\(s)'")
}
return value
}