tuweni / org.apache.tuweni.ethash / EthHash

EthHash

open class EthHash (source)

Implementation of EthHash utilities for Ethereum mining algorithms.

Constructors

<init>

EthHash()

Implementation of EthHash utilities for Ethereum mining algorithms.

Properties

ACCESSES

static var ACCESSES: Int

number of accesses in hashimoto loop

CACHE_BYTES_GROWTH

static var CACHE_BYTES_GROWTH: Long

cache growth per epoch

CACHE_BYTES_INIT

static var CACHE_BYTES_INIT: Long

bytes in cache at genesis

CACHE_MULTIPLIER

static var CACHE_MULTIPLIER: Int

Size of the DAG relative to the cache

CACHE_ROUNDS

static var CACHE_ROUNDS: Int

number of rounds in cache production

DATASET_BYTES_GROWTH

static var DATASET_BYTES_GROWTH: Long

dataset growth per epoch

DATASET_BYTES_INIT

static var DATASET_BYTES_INIT: Long

bytes in dataset at genesis

DATASET_PARENTS

static var DATASET_PARENTS: Int

number of parents of each dataset element

EPOCH_LENGTH

static var EPOCH_LENGTH: Int

blocks per epoch

FNV_PRIME

static var FNV_PRIME: Int

HASH_BYTES

static var HASH_BYTES: Int

hash length in bytes

MIX_BYTES

static var MIX_BYTES: Int

width of mix

WORD_BYTES

static var WORD_BYTES: Int

Bytes in word.

Functions

calcDatasetItem

open static fun calcDatasetItem(cache: Array<UInt32>, index: Int): Bytes

Calculate a data set item based on the previous cache for a given index

epoch

open static fun epoch(block: Long): Long

Calculates the EthHash Epoch for a given block number.

getCacheSize

open static fun getCacheSize(block_number: Long): Int

Provides the size of the cache at a given block number

getFullSize

open static fun getFullSize(block_number: Long): Long

Provides the size of the full dataset at a given block number

mkCache

open static fun mkCache(cacheSize: Int, block: Long): Array<UInt32>

Generates the EthHash cache for given parameters.