Documentation ¶
Overview ¶
Package wtf23a implements the encoding used by Dwarf Fortress for save files created before version 40d.
Ported from http://dwarffortresswiki.org/index.php/User:Quietust/wtf23a.php
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidIndex = errors.New("wtf23a: invalid header index")
ErrInvalidIndex is returned if a header has an index greater than the size of the state array or is not an integer.
Functions ¶
func NewReader ¶
NewReader wraps an io.Reader to decode Dwarf Fortress 23a's obfuscated file encoding.
func NewWriter ¶
NewWriter wraps an io.Writer to output Dwarf Fortress 23a's obfuscated file encoding. ZeroHeader and RandomHeader(r) are predefined header generators.
func RandomHeader ¶
RandomHeader returns a function that can be used with NewWriter to generate random valid header values.
Types ¶
type Header ¶
Header is the header used to store the initial state of a wtf23a segment.
func ReadHeader ¶
ReadHeader reads a Header from an io.Reader.
func ZeroHeader ¶
func ZeroHeader() Header
ZeroHeader is a function that can be used with NewWriter to generate headers that do not obfuscate the data.