uint
uint copied to clipboard
Replace `B256` aliases with `u8` arrays `B256([u8;32])`
Hi @recmo are you open to replacing current B
types that are aliases for U
with [u8;32], we will do the legwork if you approve it.
Current B types in revm that i need are made with primitive-types
macros and have some From/Serde added to them:
https://github.com/bluealloy/revm/blob/afc30663270f77df9b4399ad9d4cfb0ad2b814ec/crates/primitives/src/bits.rs#L4-L21
This would make a lot of projects be able to directly import ruint: ethers, reth, foundry, revm.
It's easy to get a &[u8;N]
view on Uint
using .as_le_slice()
, from_le_bytes
or even .as_le_slice_mut()
. Does that solve the problem?
Note that this requires a little-endian architecture (which is basically universal).
It's easy to get a
&[u8;N]
view onUint
using.as_le_slice()
,from_le_bytes
or even.as_le_slice_mut()
. Does that solve the problem?Note that this requires a little-endian architecture (which is basically universal).
Yeah, but most crypto libs work with big endian it is kinda expected for hash/bits to be in that format, I should have started with that.