Made HashDigest extend NetworkElement

This commit is contained in:
Nadav Kohen 2018-05-25 10:03:15 -05:00
parent e07fae86cb
commit 04bb83ec4c

View file

@ -1,17 +1,12 @@
package org.bitcoins.core.crypto
import org.bitcoins.core.util.{ Factory, BitcoinSUtil }
import org.bitcoins.core.protocol.NetworkElement
import org.bitcoins.core.util.{ BitcoinSUtil, Factory }
/**
* Created by chris on 5/24/16.
*/
sealed abstract class HashDigest {
/** The message digest represented in bytes */
def bytes: Seq[Byte]
/** The message digest represented in hexadecimal */
def hex: String = BitcoinSUtil.encodeHex(bytes)
sealed abstract class HashDigest extends NetworkElement {
/**
* Flips the endianness of the byte sequence.
* Since bitcoin unfortunately has inconsistent endianness between the protocol