Skip to content

Commit

Permalink
use + instead of bitwise or
Browse files Browse the repository at this point in the history
  • Loading branch information
TAdev0 committed Aug 13, 2024
1 parent 1997190 commit c8560c9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/utils.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ pub impl HashIntoU256 of Into<Hash, u256> {
let mut low: u128 = 0;
let mut high: u128 = 0;

low = low | (a.into());
low = low | shl((b.into()), 32_u32);
low = low | shl((c.into()), 64_u32);
low = low | shl((d.into()), 96_u32);

high = high | (e.into());
high = high | shl((f.into()), 32_u32);
high = high | shl((g.into()), 64_u32);
high = high | shl((h.into()), 96_u32);
low += (a.into());
low += shl((b.into()), 32_u32);
low += shl((c.into()), 64_u32);
low += shl((d.into()), 96_u32);

high += (e.into());
high += shl((f.into()), 32_u32);
high += shl((g.into()), 64_u32);
high += shl((h.into()), 96_u32);

u256 { low, high }
}
Expand Down

0 comments on commit c8560c9

Please sign in to comment.