NEWTON
Asked
4 months ago
52
views
0
Hey! The title sort of summarizes the question. I was wondering if there's any project where I can see an example of how something like keccak256(abi.encodePacked(var1, var2, var3))
could be achieved in starknet.
If there were a way to concatenate bytes, I think it wouldn't be too complicated, but such a string would never fit in a felt, and using a struct won't result in the same output.
So yes, my question is if there's an equivalent way to achieve this behavior in cairo.
0x63D4...320eE2
asked
4 months ago
0
Accepted answer
Hi, There is no "out of the box" way of doing this to my knowledge.
So you need to look at the formal specification and replicate it in Cairo (at least that's what people have done thus far). Yeah.. not an ideal scenario ^^
0x5EF2...46c5dd
answered
4 months ago
0
Not a real answer, but there is a similar question What should I use to execute abi.encodePacked from solidity in starknet?
Newton
answered
4 months ago
Is there a Cairo equivalent to Keccak256(abi.encode(parameters))?
How to check for smaller Uints in Cairo?
What should I use to execute abi.encodePacked from solidity in starknet?
How to check if a contract has been deployed at a certain address in cairo?
How to calculate the sum of the digits of a felt in Cairo?
What is SHARP in Cairo Language?
How to modify keccak.cairo and/or packed_keccak.cairo to compute a 512bits keccak hash instead of 256 bits?
What resources are required to run a Pathfinder node?
What's the best advanced StarkNet guide?
Why should I run a Pathfinder node?
StarknetPy Error in get_balance_sync (StarknetErrorCode.ENTRY_POINT_NOT_FOUND_IN_CONTRACT)
Cairo: Cannot unpack multiplication error
Are you able to nest mappings in Cairo like you can in Solidity?
How many Cairo steps does it take to compute one Pedersen hash?