Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Sources/Hiero/Transaction/TransactionHash.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

import Foundation

/// The SHA-384 hash of a transaction, used to uniquely identify transactions on the network.
public struct TransactionHash: CustomStringConvertible {
/// Creates a transaction hash by computing SHA-384 of the given data.
internal init(hashing data: Data) {
self.data = Sha2.sha384(data)
}

/// The raw bytes of the SHA-384 hash.
public let data: Data

/// Returns the hash as a hex-encoded string.
public var description: String {
data.hexStringEncoded()
}
Expand Down
Loading