Skip to content

Commit

Permalink
javadoc
Browse files Browse the repository at this point in the history
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
  • Loading branch information
shemnon committed Apr 20, 2023
1 parent 7ab6f63 commit b8ab092
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions evm/src/main/java/org/hyperledger/besu/evm/internal/Words.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,21 @@ static int readBigEndianI16(final int index, final byte[] array) {
return (array[index] << 8) | (array[index + 1] & 0xff);
}

/**
* Get the big-endian Bytes representation of an unsigned int, including leading zeros
* @param value the int value
* @return a Bytes object of the value, Big Endian order
*/
static Bytes intBytes(final int value) {
return Bytes.of(
(byte) (value >>> 24), (byte) (value >>> 16), (byte) (value >>> 8), (byte) value);
}

/**
* Get the big-endian Bytes representation of an unsigned int, including leading zeros
* @param value the long value
* @return a Bytes object of the value, Big Endian order
*/
static Bytes longBytes(final long value) {
return Bytes.of(
(byte) (value >>> 56),
Expand Down

0 comments on commit b8ab092

Please sign in to comment.