Skip to content

Commit

Permalink
Update get_bitfield_bit logic to have little endian bit numbering. (#456
Browse files Browse the repository at this point in the history
)
  • Loading branch information
schroedingerscode authored Mar 11, 2019
1 parent 34fcae0 commit a396bb6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ public static UnsignedLong get_domain(Fork fork, UnsignedLong epoch, int domain_
* @param bitPosition - The index.
*/
public static int get_bitfield_bit(Bytes bitfield, int bitPosition) {
return (bitfield.get(bitPosition / 8) >> (7 - (bitPosition % 8))) % 2;
return (bitfield.get(bitPosition / 8) >> (bitPosition % 8)) % 2;
}

/**
Expand Down

0 comments on commit a396bb6

Please sign in to comment.