See the Solidity documentation for 0.5 breaking changes for the difference between
The ABI encoder now properly pads byte arrays and strings from calldata (
msg.data and external function parameters) when used in external function calls and in
abi.encode. For unpadded encoding, use
abi.encodePacked is a non-standard packed mode
abi.encodePacked() , Solidity supports a non-standard packed mode where:
- types shorter than 32 bytes are neither zero padded nor sign extended and
- dynamic types are encoded in-place and without the length.
- array elements are padded, but still encoded in-place
Furthermore, structs as well as nested arrays are not supported.
I am not sure why the tutorial they give uses a mix of
abi.encodePacked rather than just using
You could look at OpenZeppelin Contracts ECDSA to verify signed messages.