Skip to content

Is there an equivalent to keccak256(abi.encode(*some address*)) in web3j? #1953

Closed Answered by NickSneo
andras-ballai asked this question in Q&A
Discussion options

You must be logged in to vote

You mean this -

/**
     * Keccak-256 hash function.
     *
     * @param hexInput hex encoded input data with optional 0x prefix
     * @return hash value as hex encoded string
     */
    public static String sha3(String hexInput) {
        byte[] bytes = Numeric.hexStringToByteArray(hexInput);
        byte[] result = sha3(bytes);
        return Numeric.toHexString(result);
    }

This is in Hash Class - https://github.com/web3j/web3j/blob/master/utils/src/main/java/org/web3j/crypto/Hash.java

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by NickSneo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants