Skip to content

Commit

Permalink
add appendUint64
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz834 committed Jul 21, 2023
1 parent b689602 commit 189d768
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,16 @@ func appendUint32(b []byte, v uint32) []byte {
byte(v),
)
}

func appendUint64(b []byte, v uint64) []byte {
return append(b,
byte(v>>56),
byte(v>>48),
byte(v>>40),
byte(v>>32),
byte(v>>24),
byte(v>>16),
byte(v>>8),
byte(v),
)
}

0 comments on commit 189d768

Please sign in to comment.