I am going to get the same value that is produced by keccak256 in solidity.
This is the code in my solidity file and I want to get the same value in the javascript file using ethers or web3.
bytes32 node = keccak256(abi.encodePacked(nodeString));
I got the same value of abi.encodePacked(nodeString)) by using ethers.utils.solidityPack.
const abiEncodedPackedString = ethers.utils.solidityPack(['string'], [nodeString]);
But when I tried ethers.utils.solidityKeccak256, the result wasn't the same as node in solidity.
const nodeInJavascript = ethers.utils.solidityKeccak256(['string], [abiEncodePackedString]);
I have also tried ethers.utils.keccak256(abiEncodePackedString) but I couldn't get the result either.