Usage Guide
- 23 Oct 2023
- 1 Minute to read
- DarkLight
- PDF
Usage Guide
- Updated on 23 Oct 2023
- 1 Minute to read
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
This section is a usage guide of the various Radix Engine Toolkit wrappers alongside example usages.
Notes
All of the Swift examples provided in this section depend on a utility file that contains the following code:
import Foundation extension String { func hexToData() -> Data? { var data = Data() var startIndex = self.startIndex while startIndex < self.endIndex { let endIndex = self.index(startIndex, offsetBy: 2) if let byte = UInt8(self[startIndex..<endIndex], radix: 16) { data.append(byte) } else { return nil // Invalid hex string } startIndex = endIndex } return data } }
Was this article helpful?