XYOracleNetwork/sdk-core-kotlin

View on GitHub
core-android-library/src/main/kotlin/network/xyo/sdkcorekotlin/hashing/XyoHash.kt

Summary

Maintainability
A
0 mins
Test Coverage
package network.xyo.sdkcorekotlin.hashing

import network.xyo.sdkobjectmodelkotlin.structure.XyoObjectStructure

/**
 * A base class for containing and encoding hashes.
 */
abstract class XyoHash(byteArray: ByteArray, offset: Int = 0)  : XyoObjectStructure(byteArray, offset) {
    /**
     * The encoded hash.
     */
    abstract val hash : ByteArray

    /**
     * A base class for creating hashes.
     */
    abstract class XyoHashProvider {

        /**
         * Creates a hash given a ByteArray.
         */
        abstract suspend fun createHash (data: ByteArray) : XyoHash
    }
}