GNSPS / solidity-bytes-utils

Utility Solidity library composed of basic operations for tightly packed bytes arrays

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding functions to convert slices of bytes to/from uint{8,16,32,64}

chetmurthy opened this issue · comments

I'd like to start adding functions to convert slices of bytes to/from uint8, uint16, etc. But I know nothing of Solidity's assembler, so I'd have to write these in Solidity itself, which I'm presuming will be inefficient (can already see that for some operations, the assembler is just faster).

Do you have any suggestions for where to go, to start learning assembler?

I'd say that the best place to learn about it is here: http://solidity.readthedocs.io/en/develop/assembly.html and just experimenting with Remix to make sure everything works out.

But those functions you can just copy the uint256 one and try to modify what you think are the constants there and submit a PR and I'll help you work through it! 😄

Finally got this going with #19! Closing. 😄