mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-19 09:52:09 +01:00
Cache DoubleSha256Digest.hex (#1932)
* Cache DoubleSha256Digest.hex * Cache little endian versino too
This commit is contained in:
parent
c1d0d66398
commit
43ba2477b5
@ -116,6 +116,8 @@ case class DoubleSha256Digest(bytes: ByteVector) extends HashDigest {
|
|||||||
|
|
||||||
lazy val flip: DoubleSha256DigestBE = DoubleSha256DigestBE(bytes.reverse)
|
lazy val flip: DoubleSha256DigestBE = DoubleSha256DigestBE(bytes.reverse)
|
||||||
|
|
||||||
|
override lazy val hex: String = bytes.toHex
|
||||||
|
|
||||||
override def toString = s"DoubleSha256Digest($hex)"
|
override def toString = s"DoubleSha256Digest($hex)"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,6 +142,8 @@ case class DoubleSha256DigestBE(bytes: ByteVector) extends HashDigest {
|
|||||||
def flip: DoubleSha256Digest =
|
def flip: DoubleSha256Digest =
|
||||||
DoubleSha256Digest.fromBytes(bytes.reverse)
|
DoubleSha256Digest.fromBytes(bytes.reverse)
|
||||||
|
|
||||||
|
override lazy val hex: String = bytes.toHex
|
||||||
|
|
||||||
override def toString = s"DoubleSha256BDigestBE($hex)"
|
override def toString = s"DoubleSha256BDigestBE($hex)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user