Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 724 Bytes

File metadata and controls

37 lines (25 loc) · 724 Bytes
title @hash

Compute the hash of a string with keccak256 (default) or sha256.

Returns: bytes32

Syntax

@hash(text algorithm?)

Arguments

Name Type Description
text string String to hash (e.g. a function signature)
[algorithm] string keccak256 (default) or sha256

Examples

# Compute a function selector
set $sel @hash("transfer(address,uint256)")

# Hash with sha256 instead of keccak256
set $digest @hash("an example" sha256)

See Also