Minor: add a convenience extension function to convert from byte arrays to SHA256 hashes.

This commit is contained in:
Mike Hearn 2015-11-27 15:42:55 +01:00
parent 19cd2069c7
commit 60f29339ee

View File

@ -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