Skip to content

Commit

Permalink
new bytes method
Browse files Browse the repository at this point in the history
  • Loading branch information
duggavo committed Jun 23, 2024
1 parent 67c53f8 commit b034526
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions uint128.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,12 @@ func (u Uint128) PutBytesBE(b []byte) {
binary.BigEndian.PutUint64(b[8:], u.Lo)
}

func (u Uint128) Bytes() [16]byte {
buf := [16]byte{}
u.PutBytes(buf[:])
return buf
}

// Big returns u as a *big.Int.
func (u Uint128) Big() *big.Int {
i := new(big.Int).SetUint64(u.Hi)
Expand Down

0 comments on commit b034526

Please sign in to comment.