mirror of
https://github.com/corda/corda.git
synced 2025-04-06 19:07:08 +00:00
Minor: add a convenience extension function to convert from byte arrays to SHA256 hashes.
This commit is contained in:
parent
19cd2069c7
commit
60f29339ee
@ -32,6 +32,8 @@ sealed class SecureHash(bits: ByteArray) : OpaqueBytes(bits) {
|
||||
// In future, maybe SHA3, truncated hashes etc.
|
||||
}
|
||||
|
||||
fun ByteArray.sha256(): SecureHash.SHA256 = SecureHash.sha256(this)
|
||||
|
||||
/**
|
||||
* A wrapper around a digital signature. The covering field is a generic tag usable by whatever is interpreting the
|
||||
* signature. It isn't used currently, but experience from Bitcoin suggests such a feature is useful, especially when
|
||||
|
Loading…
x
Reference in New Issue
Block a user