Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

web3-utils keccak256 raise error for string type data #5287

@nazarhussain

Description

@nazarhussain

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

If we do the current keccak256 for string data it raise error.

TypeError: Expected Uint8Array data

Expected Behavior

Considering the 1.x compatibility, we have to accept a string input.

Steps to Reproduce

keccak256("my data"); 

Web3.js Version

4.x

Environment

  • Operating System: N/A
  • Browser: N/A
  • Node.js Version: 16.x
  • NPM Version: N/A

Anything Else?

No response

Metadata

Metadata

Labels

4.x4.0 relatedBugAddressing a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions