Fixed HKEYS command for SQLite3 backend.

This commit is contained in:
Sascha L. Teichmann
2014-08-16 17:41:54 +02:00
parent b6c041b896
commit 6efb976ba2
2 changed files with 11 additions and 3 deletions

View File

@ -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))
}