func MonotonicMarshalPhantom() []byte {
	return []byte{PhantomIdentifier}
}
/* Marshal phantom
package octosql
import (
	"encoding/binary"
	"math"
	"sort"
	"time"
	"github.com/pkg/errors"
)
const (
	NullIdentifier      = 1   
	PhantomIdentifier   = 2   
	IntIdentifier       = 3   
	FloatIdentifier     = 4   
	BoolIdentifier      = 5   
	StringIdentifier    = 6   
	TimestampIdentifier = 7   
	DurationIdentifier  = 8   
	TupleIdentifier     = 9   
	ObjectIdentifier    = 10  
	StringDelimiter     = 11
	TupleDelimiter      = 12
)
const (
	NumberMarshalLength      = 1 + 8  
	BoolMarshalLength        = 1 + 1  
	NonexistentMarshalLength = 1      
)
const (
	BYTE_OFFSET         = 128
	MinimalTupleLength  = 1 + 1 + 1  
	MinimalStringLength = 1 + 1      
)
func (v *Value) MonotonicMarshal() []byte {
	return monotonicMarshal(v)
}
func (v *Value) ReversedMonotonicMarshal() []byte {
	marshal := monotonicMarshal(v)
	var reversedMarshal []byte
	for _, x := range marshal {
		reversedMarshal = append(reversedMarshal, x ^ 255)
	}
	reversedMarshal = append(reversedMarshal, 255)
	return reversedMarshal
}
func (v *Value) MonotonicUnmarshal(bytes []byte) error {
	if len(bytes) == 0 {
		return errors.New("empty byte slice given to unmarshal")
	}
	identifier := int(bytes[0])
	var finalValue Value
	switch identifier {
	case NullIdentifier:
		err := MonotonicUnmarshalNull(bytes)
		if err != nil {
			return err
		}
		finalValue = MakeNull()
	case PhantomIdentifier:
		err := MonotonicUnmarshalPhantom(bytes)
		if err != nil {
			return err
		}
		finalValue = MakePhantom()
	case IntIdentifier:
		result, err := MonotonicUnmarshalInt64(bytes)
		if err != nil {
			return err
		}
		finalValue = MakeInt(int(result))
	case FloatIdentifier:
		result, err := MonotonicUnmarshalFloat(bytes)
		if err != nil {
			return err
		}
		finalValue = MakeFloat(result)
	case BoolIdentifier:
		result, err := MonotonicUnmarshalBool(bytes)
		if err != nil {
			return err
		}
		finalValue = MakeBool(result)
	case StringIdentifier:
		result, err := MonotonicUnmarshalString(bytes)
		if err != nil {
			return err
		}
		finalValue = MakeString(result)
	case TimestampIdentifier:
		result, err := MonotonicUnmarshalTime(bytes)
		if err != nil {
			return err
		}
		finalValue = MakeTime(result)
	case DurationIdentifier:
		result, err := MonotonicUnmarshalDuration(bytes)
		if err != nil {
			return err
		}
		finalValue = MakeDuration(result)
	case TupleIdentifier:
		result, err := MonotonicUnmarshalTuple(bytes)
		if err != nil {
			return err
		}
		finalValue = MakeTuple(result)
	case ObjectIdentifier:
		result, err := UnmarshalObject(bytes)
		if err != nil {
			return err
		}
		finalValue = MakeObject(result)
	default:
		panic("unsupported type")
	}
	*v = finalValue
	return nil
}
func monotonicMarshal(v *Value) []byte {
	switch v.GetType() {
	case TypeString:
		return MonotonicMarshalString(v.AsString())
	case TypeInt:
		return MonotonicMarshalInt64(int64(v.AsInt()))
	case TypeBool:
		return MonotonicMarshalBool(v.AsBool())
	case TypeNull:
		return MonotonicMarshalNull()
	case TypePhantom:
		return MonotonicMarshalPhantom()
	case TypeTime:
		return MonotonicMarshalTime(v.AsTime())
	case TypeDuration:
		return MonotonicMarshalDuration(v.AsDuration())
	case TypeFloat:
		return MonotonicMarshalFloat(v.AsFloat())
	case TypeTuple:
		return MonotonicMarshalTuple(v.AsSlice())
	case TypeObject:
		return MarshalObject(v.AsMap())
	default:
		panic("unknown type!")
	}
}
func MonotonicMarshalNull() []byte {
	return []byte{NullIdentifier}
}
func MonotonicUnmarshalNull(b []byte) error {
	if len(b) != NonexistentMarshalLength {
		return errors.New("incorrect null key size")
	}
	if b[0] != NullIdentifier {
		return errors.New("incorrect null key value")
	}
	return nil
}