Skip to content

Hash

Utility functions for hashing (keccak256, sha256, etc).

Examples

import { Hash } from 'ox'
 
const value = Hash.keccak256('0xdeadbeef')
// '0xd4fd4e189132273036449fc9e11198c739161b4c0116a9a2dccdfa1c492006f1'

Functions

NameDescription
Hash.keccak256Calculates the Keccak256 hash of a Bytes.Bytes or Hex.Hex value.
Hash.ripemd160Calculates the Ripemd160 hash of a Bytes.Bytes or Hex.Hex value.
Hash.sha256Calculates the Sha256 hash of a Bytes.Bytes or Hex.Hex value.
Hash.validateChecks if a string is a valid hash value.