mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-07-02 16:10:49 +02:00
Completed implementation of interleaver. Needs testing!
This commit is contained in:
@ -143,3 +143,31 @@ func TransformPlainToInterleaved(pos int64) int64 {
|
||||
func TransformInterleavedPlain(pos int64) int64 {
|
||||
return CoordToPlain(InterleavedToCoord(pos))
|
||||
}
|
||||
|
||||
func SelectKeySplitter(interleaved bool) KeySplitter {
|
||||
if interleaved {
|
||||
return InterleavedToCoord
|
||||
}
|
||||
return PlainToCoord
|
||||
}
|
||||
|
||||
func SelectKeyJoiner(interleaved bool) KeyJoiner {
|
||||
if interleaved {
|
||||
return CoordToInterleaved
|
||||
}
|
||||
return CoordToPlain
|
||||
}
|
||||
|
||||
func SelectKeyDecoder(interleaved bool) KeyDecoder {
|
||||
if interleaved {
|
||||
return DecodeFromBigEndian
|
||||
}
|
||||
return DecodeStringFromBytes
|
||||
}
|
||||
|
||||
func SelectKeyEncoder(interleaved bool) KeyEncoder {
|
||||
if interleaved {
|
||||
return EncodeToBigEndian
|
||||
}
|
||||
return EncodeStringToBytes
|
||||
}
|
||||
|
Reference in New Issue
Block a user