Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Tron transaction signing #60

Conversation

johnnynanjiang
Copy link

No description provided.

///
/// - returns: Data represented by this hexadecimal string.

public func hexadecimal() -> Data? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use the existing Data(hexString:)

public func hexadecimal() -> Data? {
var data = Data(capacity: characters.count / 2)

let regex = try! NSRegularExpression(pattern: "[0-9a-f]{1,2}", options: .caseInsensitive)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could potentially be slow, why do we need a regex?

///
/// - returns: `String` representation of this `Data` object.

public func hexadecimal() -> String {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have Data.hexString

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants