UgiUtil Class Reference

Overview


UgiUtil is a collection of useful static methods

Class Methods

(NSString *_Nullable) + dataToHexString:
 
Utility to convert NSData to a string of hex digits (uppercase) More...
 
(NSString *_Nullable) + bytesToHexString:length:
 
Utility to convert bytes to a string of hex digits (uppercase) More...
 
(NSData *_Nullable) + hexStringToData:
 
Utility to convert a hex string to NSData More...
 
(int) + hexStringToInt:
 
Utility to convert a hex string to an integer More...
 
(int) + hexStringToBytes:toBuffer:bufferSize:
 
Utility to convert string to bytes More...
 
(NSString *) + stackTraceWithFrames:removeRedacted:skipTopFrame:
 
Utility to get a stack trace More...
 

Instance Method Documentation

◆ dataToHexString:()

+ (NSString * _Nullable) dataToHexString: (NSData *_Nullable)  data


Utility to convert NSData to a string of hex digits (uppercase)

Parameters
dataNSData object to convert to a string
Returns
String of hex digits

◆ bytesToHexString:length:()

+ (NSString * _Nullable) bytesToHexString: (const uint8_t *_Nullable)  ba
length: (int)  len 


Utility to convert bytes to a string of hex digits (uppercase)

Parameters
baByte array to convert
lenLength of byte array
Returns
String of hex digits

◆ hexStringToData:()

+ (NSData * _Nullable) hexStringToData: (NSString *_Nullable)  s


Utility to convert a hex string to NSData

Parameters
sString to convert
Returns
NSData

◆ hexStringToInt:()

+ (int) hexStringToInt: (NSString *_Nullable)  s


Utility to convert a hex string to an integer

Parameters
sString to convert
Returns
integer

◆ hexStringToBytes:toBuffer:bufferSize:()

+ (int) hexStringToBytes: (NSString *_Nullable)  s
toBuffer: (uint8_t *_Nonnull)  ba
bufferSize: (int)  bufferSize 


Utility to convert string to bytes

Parameters
sString to convert
baBuffer to put result in
bufferSizeSize of the buffer in bytes
Returns
Number of bytes

◆ stackTraceWithFrames:removeRedacted:skipTopFrame:()

+ (NSString *) stackTraceWithFrames: (int)  numFrames
removeRedacted: (BOOL)  removeRedacted
skipTopFrame: (BOOL)  skipTopFrame 


Utility to get a stack trace

Parameters
numFramesNumber of frames
removeRedactedYES to remove "redacted" stack frames
skipTopFrameYES to skip the stack frame of the caller
Returns
Stack trace