diff --git a/common/coords.go b/common/coords.go index e7c3490..0491549 100644 --- a/common/coords.go +++ b/common/coords.go @@ -161,6 +161,22 @@ func IdentityTranscoder(key []byte) ([]byte, error) { return key, nil } +func TranscodePlainToInterleaved(key []byte) ([]byte, error) { + if pos, err := DecodeStringFromBytesToInterleaved(key); err != nil { + return nil, err + } else { + return EncodeToBigEndian(pos) + } +} + +func TranscodeInterleavedToPlain(key []byte) ([]byte, error) { + if pos, err := DecodeFromBigEndian(key); err != nil { + return nil, err + } else { + return EncodeStringToBytes(TransformInterleavedToPlain(pos)) + } +} + func SelectKeySplitter(interleaved bool) KeySplitter { if interleaved { return InterleavedToCoord