mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-07-14 22:10:29 +02:00
Fixed HKEYS command for SQLite3 backend.
This commit is contained in:
@ -4,9 +4,17 @@
|
||||
|
||||
package common
|
||||
|
||||
import "strconv"
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Constructs a database key out of byte slice.
|
||||
func DecodePosFromBytes(key []byte) (pos int64, err error) {
|
||||
return strconv.ParseInt(string(key), 10, 64)
|
||||
}
|
||||
|
||||
// Encode a block pos to byte slice.
|
||||
func EncodePosToBytes(key int64) []byte {
|
||||
return []byte(fmt.Sprintf("%d", key))
|
||||
}
|
||||
|
Reference in New Issue
Block a user