hash

Computes the hash of the input bytes using this hash function.

This is used throughout drand for:

  • Deriving randomness from signatures (randomness = hash(signature))

  • Hashing beacon messages before signing (message = hash(round || previous))

Return

The hash digest (32 bytes for both SHA-256 and Keccak-256)

Parameters

data

The bytes to hash