I am not sure if this is a general bit manipulation related question or something specific to Ethereum. But I am reading a part of the ethereum specification here and I am confused by the bit related operations.
For instance, in the Example section a uint32 value of 69 padded to 32 bytes became 0x0000000000000000000000000000000000000000000000000000000000000045.
This I understand. Turn 69 to hex, which is 45 then pad it with 30 zeros.
But a value of "abc" after being left aligned became 0x6162630000000000000000000000000000000000000000000000000000000000
Now I am confused.
Why is it that the zeros here are added to the right? I understand where the 0x616263 comes from, which is the hex representation of "abc". But when padding the hex representation of 69 above, the zeros were added on the left, but with "abc" the zeros are being added on the right side. Why is this the case?
[link] [comments]
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments