protected function serializeHiddenField($value)
    {
        $value = SwatString::signedSerialize($value, $this->salt);

        // escape special characters that confuse browsers (mostly IE;
        // null characters confuse all browsers)
        $value = str_replace('\\', '\\\\', $value);
        $value = str_replace("\x00", '\x00', $value);
        $value = str_replace("\x0a", '\x0a', $value);
        $value = str_replace("\x0d", '\x0d', $value);

        return $value;
    }