github.com/cockroachdb/pebble@v1.1.2/cmd/pebble/util.go (about)

     1  // Copyright 2018 The LevelDB-Go and Pebble Authors. All rights reserved. Use
     2  // of this source code is governed by a BSD-style license that can be found in
     3  // the LICENSE file.
     4  
     5  package main
     6  
     7  func encodeUint32Ascending(b []byte, v uint32) []byte {
     8  	return append(b, byte(v>>24), byte(v>>16), byte(v>>8), byte(v))
     9  }
    10  
    11  func encodeUint64Ascending(b []byte, v uint64) []byte {
    12  	return append(b,
    13  		byte(v>>56), byte(v>>48), byte(v>>40), byte(v>>32),
    14  		byte(v>>24), byte(v>>16), byte(v>>8), byte(v))
    15  }