mirror of
https://github.com/Luigi30/FruitMachine-Swift.git
synced 2024-11-23 17:33:47 +00:00
26 lines
492 B
Swift
26 lines
492 B
Swift
//
|
|
// IntegerExtensions.swift
|
|
// FruitMachine
|
|
//
|
|
// Created by Christopher Rohl on 7/20/17.
|
|
// Copyright © 2017 Christopher Rohl. All rights reserved.
|
|
//
|
|
|
|
import Cocoa
|
|
|
|
extension UInt16 {
|
|
static func + (left: UInt16, right: UInt8) -> UInt16 {
|
|
return left + UInt16(right)
|
|
}
|
|
|
|
func asHexString() -> String {
|
|
return String(format: "%04X", self)
|
|
}
|
|
}
|
|
|
|
extension UInt8 {
|
|
func asHexString() -> String {
|
|
return String(format: "%02X", self)
|
|
}
|
|
}
|