Documentation
¶
Overview ¶
Package kv3 reads binary KeyValues3 versions 4 and 5 and writes version 5, the format Source 2 compiled resources store their data in.
Decode accepts untrusted input: malformed data returns an error and never panics, and a value budget bounds the work one buffer can demand.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode reads binary KeyValues3 data. Objects decode as map[string]any and arrays as []any; the scalars as nil, bool, int64, uint64, float64, string and Blob. Flags are dropped.
func Encode ¶
Encode writes value as binary KeyValues3 version 5 with LZ4 compression, the form the resource compiler writes. It takes nil, bool, every integer type, float32, float64, string, []any, Object and map[string]any. An integer is written in the narrowest of int32, uint32, int64 and uint64 that holds it.