NEWTON

NEWTON


Popular tags

    Equivalent to Solidity's keccak256(abi.encodePacked())?

    Asked

    2 months ago

    46

    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.

      soliditycairostarknet

    0x63D4...320eE2

    asked

    2 months ago


    2 answers

    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

    1 month ago

    Your answer

    NEWTON

    NEWTON