Documentation ¶
Index ¶
- Constants
- Variables
- func AppendBool(v bool, buf []byte, off *tally.UTally) int
- func AppendBytes(v []byte, buf []byte, off *tally.UTally) (wrote int)
- func AppendComplex128(value complex128, buffer []byte, offset *tally.UTally) (wrote int)
- func AppendComplex64(value complex64, buffer []byte, offset *tally.UTally) int
- func AppendFloat32(v float32, buf []byte, off *tally.UTally) int
- func AppendFloat64(v float64, buf []byte, off *tally.UTally) int
- func AppendInt(v int, buf []byte, off *tally.UTally) (wrote int)
- func AppendInt16(v int16, buf []byte, off *tally.UTally) int
- func AppendInt32(v int32, buf []byte, off *tally.UTally) int
- func AppendInt64(v int64, buf []byte, off *tally.UTally) int
- func AppendInt8(v int8, buf []byte, off *tally.UTally) int
- func AppendString(v string, buf []byte, off *tally.UTally) (wrote int)
- func AppendUint(v uint, buf []byte, off *tally.UTally) (wrote int)
- func AppendUint16(v uint16, buf []byte, off *tally.UTally) (wrote int)
- func AppendUint32(v uint32, buf []byte, off *tally.UTally) (wrote int)
- func AppendUint64(v uint64, buf []byte, off *tally.UTally) (wrote int)
- func AppendUint8(v uint8, buf []byte, off *tally.UTally) (wrote int)
- func DeserializeBool(buf []byte, off *tally.UTally) (bool, error)
- func DeserializeBytes(buf []byte, off *tally.UTally) ([]byte, error)
- func DeserializeComplex128(buffer []byte, offset *tally.UTally) (complex128, error)
- func DeserializeComplex64(buffer []byte, offset *tally.UTally) (complex64, error)
- func DeserializeFloat32(v []byte, off *tally.UTally) (out float32, err error)
- func DeserializeFloat64(v []byte, off *tally.UTally) (out float64, err error)
- func DeserializeInt(v []byte, off *tally.UTally) (int, error)
- func DeserializeInt16(v []byte, off *tally.UTally) (out int16, err error)
- func DeserializeInt32(v []byte, off *tally.UTally) (out int32, err error)
- func DeserializeInt64(v []byte, off *tally.UTally) (out int64, err error)
- func DeserializeInt8(v []byte, off *tally.UTally) (int8, error)
- func DeserializeString(buf []byte, off *tally.UTally) (string, error)
- func DeserializeUDigit(b byte) uint8
- func DeserializeUint(v []byte, off *tally.UTally) (uint, error)
- func DeserializeUint16(v []byte, off *tally.UTally) (out uint16, err error)
- func DeserializeUint32(v []byte, off *tally.UTally) (out uint32, err error)
- func DeserializeUint64(v []byte, off *tally.UTally) (out uint64, err error)
- func DeserializeUint8(v []byte, off *tally.UTally) (uint8, error)
- func IsJASCError(e error) bool
- func NewJASCByteError(pos int) error
- func NewJASCFormatError(pos int, kind ValueKind) error
- func SerializeBool(v bool) []byte
- func SerializeBytes(v []byte) []byte
- func SerializeComplex128(value complex128) []byte
- func SerializeComplex64(v complex64) []byte
- func SerializeFloat32(v float32) []byte
- func SerializeFloat64(v float64) []byte
- func SerializeInt(v int) []byte
- func SerializeInt16(v int16) []byte
- func SerializeInt32(v int32) []byte
- func SerializeInt64(v int64) []byte
- func SerializeInt8(v int8) []byte
- func SerializeString(v string) []byte
- func SerializeUint(v uint) []byte
- func SerializeUint16(v uint16) []byte
- func SerializeUint32(v uint32) []byte
- func SerializeUint64(v uint64) []byte
- func SerializeUint8(v uint8) []byte
- func SizeBool(v bool) uint
- func SizeBytes(v []byte) uint
- func SizeComplex128(v complex128) uint
- func SizeComplex64(v complex64) uint
- func SizeFloat32(v float32) uint
- func SizeFloat64(v float64) uint
- func SizeInt(v int) uint
- func SizeInt16(v int16) uint
- func SizeInt32(v int32) uint
- func SizeInt64(v int64) uint
- func SizeInt8(v int8) uint
- func SizeString(v string) uint
- func SizeUint(v uint) uint
- func SizeUint16(v uint16) uint
- func SizeUint32(v uint32) uint
- func SizeUint64(v uint64) uint
- func SizeUint8(v uint8) uint
- type BoolBufAppenderFn
- type BoolDeserializerFn
- type BoolSerializerFn
- type BoolSizeFn
- type BytesBufAppenderFn
- type BytesDeserializerFn
- type BytesSerializerFn
- type C128BufAppenderFn
- type C128DeserializerFn
- type C128SerializerFn
- type C128SizeFn
- type C64BufAppenderFn
- type C64DeserializerFn
- type C64SerializerFn
- type C64SizeFn
- type Deserializable
- type F32BufAppenderFn
- type F32DeserializerFn
- type F32SerializerFn
- type F32SizeFn
- type F64BufAppenderFn
- type F64DeserializerFn
- type F64SerializerFn
- type F64SizeFn
- type I16BufAppenderFn
- type I16DeserializerFn
- type I16SerializerFn
- type I16SizeFn
- type I32BufAppenderFn
- type I32DeserializerFn
- type I32SerializerFn
- type I32SizeFn
- type I64BufAppenderFn
- type I64DeserializerFn
- type I64SerializerFn
- type I64SizeFn
- type I8BufAppenderFn
- type I8DeserializerFn
- type I8SerializerFn
- type I8SizeFn
- type IBufAppenderFn
- type IDeserializerFn
- type ISerializerFn
- type ISizeFn
- type JASCError
- type Serializable
- type StringBufAppenderFn
- type StringDeserializerFn
- type StringSerializerFn
- type U16BufAppenderFn
- type U16DeserializerFn
- type U16SerializerFn
- type U16SizeFn
- type U32BufAppenderFn
- type U32DeserializerFn
- type U32SerializerFn
- type U32SizeFn
- type U64BufAppenderFn
- type U64DeserializerFn
- type U64SerializerFn
- type U64SizeFn
- type U8BufAppenderFn
- type U8DeserializerFn
- type U8SerializerFn
- type U8SizeFn
- type UBufAppenderFn
- type UDeserializerFn
- type USerializerFn
- type USizeFn
- type ValueKind
Examples ¶
Constants ¶
const (
Base = 57
)
Variables ¶
var ( ErrNoHeader = newJASCError("no size header in JASC value", 0) ErrInvalidJASCFormat = newJASCError("invalid format for a JASC value", 0) )
var (
TxtErrInvalidJASCByte = "unrecognized JASC byte value"
)
Functions ¶
func AppendBytes ¶ added in v1.1.0
func AppendComplex128 ¶
func AppendComplex128(value complex128, buffer []byte, offset *tally.UTally) (wrote int)
func AppendComplex64 ¶
func AppendFloat32 ¶
AppendFloat32 converts the given float32 value to base57 and writes it to the given buffer starting at off.Cur().
The given offset value will be incremented as the buffer is written and after this function call will be at the next writable offset position.
WARNING: This method makes no attempt to verify that the given byte buffer is actually long enough to hold the serialized value. The buffer size should be at least SizeFloat32(v) in length.
func AppendFloat64 ¶
AppendFloat64 converts the given float64 value to base57 and writes it to the given buffer starting at off.Cur().
The given offset value will be incremented as the buffer is written and after this function call will be at the next writable offset position.
WARNING: This method makes no attempt to verify that the given byte buffer is actually long enough to hold the serialized value. The buffer size should be at least SizeFloat64(v) in length.
func AppendInt ¶
AppendUint converts the given uint value to base57 and writes it to the given buffer starting at off.Cur().
The given offset value will be incremented as the buffer is written and after this function call will be at the next writable offset position.
WARNING: This method makes no attempt to verify that the given byte buffer is actually long enough to hold the serialized value. The buffer size should be at least SizeUint(v) in length.
func AppendInt16 ¶
AppendInt16 converts the given int16 value to base57 and writes it to the given buffer starting at off.Cur().
The given offset value will be incremented as the buffer is written and after this function call will be at the next writable offset position.
WARNING: This method makes no attempt to verify that the given byte buffer is actually long enough to hold the serialized value. The buffer size should be at least SizeInt16(v) in length.
func AppendInt32 ¶
AppendInt32 converts the given int32 value to base57 and writes it to the given buffer starting at off.Cur().
The given offset value will be incremented as the buffer is written and after this function call will be at the next writable offset position.
WARNING: This method makes no attempt to verify that the given byte buffer is actually long enough to hold the serialized value. The buffer size should be at least SizeInt32(v) in length.
func AppendInt64 ¶
AppendInt64 converts the given int64 value to base57 and writes it to the given buffer starting at off.Cur().
The given offset value will be incremented as the buffer is written and after this function call will be at the next writable offset position.
WARNING: This method makes no attempt to verify that the given byte buffer is actually long enough to hold the serialized value. The buffer size should be at least SizeInt64(v) in length.
func AppendInt8 ¶
AppendInt8 converts the given int8 value to base57 and writes it to the given buffer starting at off.Cur().
The given offset value will be incremented as the buffer is written and after this function call will be at the next writable offset position.
WARNING: This method makes no attempt to verify that the given byte buffer is actually long enough to hold the serialized value. The buffer size should be at least SizeInt8(v) in length.
func AppendUint ¶
AppendUint converts the given uint value to base57 and writes it to the given buffer starting at off.Cur().
The given offset value will be incremented as the buffer is written and after this function call will be at the next writable offset position.
WARNING: This method makes no attempt to verify that the given byte buffer is actually long enough to hold the serialized value. The buffer size should be at least SizeUint(v) in length.
func AppendUint16 ¶
AppendUint16 converts the given uint16 value to base57 and writes it to the given buffer starting at off.Cur().
The given offset value will be incremented as the buffer is written and after this function call will be at the next writable offset position.
WARNING: This method makes no attempt to verify that the given byte buffer is actually long enough to hold the serialized value. The buffer size should be at least SizeUint16(v) in length.
func AppendUint32 ¶
AppendUint32 converts the given uint32 value to base57 and writes it to the given buffer starting at off.Cur().
The given offset value will be incremented as the buffer is written and after this function call will be at the next writable offset position.
WARNING: This method makes no attempt to verify that the given byte buffer is actually long enough to hold the serialized value. The buffer size should be at least SizeUint32(v) in length.
func AppendUint64 ¶
AppendUint64 converts the given uint64 value to base57 and writes it to the given buffer starting at off.Cur().
The given offset value will be incremented as the buffer is written and after this function call will be at the next writable offset position.
WARNING: This method makes no attempt to verify that the given byte buffer is actually long enough to hold the serialized value. The buffer size should be at least SizeUint64(v) in length.
func AppendUint8 ¶
AppendUint8 converts the given uint8 value to base57 and writes it to the given buffer starting at off.Cur().
The given offset value will be incremented as the buffer is written and after this function call will be at the next writable offset position.
WARNING: This method makes no attempt to verify that the given byte buffer is actually long enough to hold the serialized value. The buffer size should be at least SizeUint8(v) in length.
func DeserializeBytes ¶ added in v1.1.0
func DeserializeComplex128 ¶
func DeserializeComplex128(buffer []byte, offset *tally.UTally) (complex128, error)
func DeserializeComplex64 ¶
func DeserializeFloat32 ¶
func DeserializeFloat64 ¶
func DeserializeUDigit ¶
func DeserializeUint16 ¶
Example ¶
input := []byte("$$%'>&7,M") offset := tally.UTally(0) for int(offset.Cur()) < len(input) { fmt.Println(j57.DeserializeUint32(input, &offset)) }
Output: 1 <nil> 255 <nil> 65535 <nil>
func DeserializeUint32 ¶
Example ¶
input := []byte("'$##$)**TS+;($##$M") offset := tally.UTally(0) for int(offset.Cur()) < len(input) { fmt.Println(j57.DeserializeUint32(input, &offset)) }
Output: 185194 <nil> 4294967295 <nil> 10556100 <nil>
func DeserializeUint64 ¶
Example ¶
input := []byte(".$C:;)<MX02%-$XP1F%)'6W,$)+JIO@IY") offset := tally.UTally(0) for int(offset.Cur()) < len(input) { fmt.Println(j57.DeserializeUint64(input, &offset)) }
Output: 567890123456789012 <nil> 12345678901234567 <nil> 123456789012345 <nil>
func DeserializeUint8 ¶
Example ¶
input := []byte("#$$$%$&$'$($)$*$+") offset := tally.UTally(0) for int(offset.Cur()) < len(input) { fmt.Println(j57.DeserializeUint8(input, &offset)) }
Output: 0 <nil> 1 <nil> 2 <nil> 3 <nil> 4 <nil> 5 <nil> 6 <nil> 7 <nil> 8 <nil>
func IsJASCError ¶
func NewJASCByteError ¶
func NewJASCFormatError ¶
func SerializeBool ¶
func SerializeBytes ¶ added in v1.1.0
func SerializeComplex128 ¶
func SerializeComplex128(value complex128) []byte
func SerializeComplex64 ¶
func SerializeFloat32 ¶
SerializeFloat32 converts the given float32 value to a base57 encoded byte slice.
The byte slice returned may be 1-7 bytes in length.
func SerializeFloat64 ¶
SerializeFloat64 converts the given float64 value to a base57 encoded byte slice.
The byte slice returned may be 1-7 bytes in length.
func SerializeInt ¶
SerializeUint converts the given uint value to a base57 encoded byte slice.
The byte slice returned may be 1-3 bytes in length.
func SerializeInt16 ¶
SerializeInt16 converts the given int16 value to a base57 encoded byte slice.
The byte slice returned may be 1-4 bytes in length.
func SerializeInt32 ¶
SerializeInt32 converts the given int32 value to a base57 encoded byte slice.
The byte slice returned may be 1-7 bytes in length.
func SerializeInt64 ¶
SerializeInt64 converts the given int64 value to a base57 encoded byte slice.
The byte slice returned may be 1-12 bytes in length.
func SerializeInt8 ¶
SerializeInt8 converts the given int8 value to a base57 encoded byte slice.
The byte slice returned may be 1-3 bytes in length.
func SerializeString ¶
func SerializeUint ¶
SerializeUint converts the given uint value to a base57 encoded byte slice.
The byte slice returned may be 1-3 bytes in length.
func SerializeUint16 ¶
SerializeUint16 converts the given uint16 value to a base57 encoded byte slice.
The byte slice returned may be 1-4 bytes in length.
func SerializeUint32 ¶
SerializeUint32 converts the given uint32 value to a base57 encoded byte slice.
The byte slice returned may be 1-7 bytes in length.
func SerializeUint64 ¶
SerializeUint64 converts the given uint64 value to a base57 encoded byte slice.
The byte slice returned may be 1-12 bytes in length.
func SerializeUint8 ¶
SerializeUint8 converts the given uint8 value to a base57 encoded byte slice.
The byte slice returned may be 1-3 bytes in length.
func SizeComplex128 ¶
func SizeComplex128(v complex128) uint
func SizeComplex64 ¶
func SizeFloat32 ¶
SizeFloat32 returns the number of bytes needed in a byte buffer to hold the serialized form of the given float32 value.
This size includes the byte needed for the number size header.
func SizeFloat64 ¶
SizeFloat64 returns the number of bytes needed in a byte buffer to hold the serialized form of the given float64 value.
This size includes the byte needed for the number size header.
func SizeInt ¶
SizeUint returns the number of bytes needed in a byte buffer to hold the serialized form of the given uint value.
This size includes the byte needed for the number size header.
func SizeInt16 ¶
SizeInt16 returns the number of bytes needed in a byte buffer to hold the serialized form of the given uint8 value.
This size includes the byte needed for the number size header.
func SizeInt32 ¶
SizeInt32 returns the number of bytes needed in a byte buffer to hold the serialized form of the given int32 value.
This size includes the byte needed for the number size header.
func SizeInt64 ¶
SizeInt64 returns the number of bytes needed in a byte buffer to hold the serialized form of the given int64 value.
This size includes the byte needed for the number size header.
func SizeInt8 ¶
SizeInt8 returns the number of bytes needed in a byte buffer to hold the serialized form of the given int8 value.
This size includes the byte needed for the number size header.
func SizeString ¶
func SizeUint ¶
SizeUint returns the number of bytes needed in a byte buffer to hold the serialized form of the given uint value.
This size includes the byte needed for the number size header.
func SizeUint16 ¶
SizeUint16 returns the number of bytes needed in a byte buffer to hold the serialized form of the given uint8 value.
This size includes the byte needed for the number size header.
func SizeUint32 ¶
SizeUint32 returns the number of bytes needed in a byte buffer to hold the serialized form of the given uint32 value.
This size includes the byte needed for the number size header.
func SizeUint64 ¶
SizeUint64 returns the number of bytes needed in a byte buffer to hold the serialized form of the given uint64 value.
This size includes the byte needed for the number size header.
Types ¶
type BoolBufAppenderFn ¶
BoolBufAppenderFn is a function type declaration matching the included SerializeBoolInto function.
type BoolDeserializerFn ¶
BoolDeserializerFn is a function type declaration matching the included DeserializeBool function.
type BoolSerializerFn ¶
BoolSerializerFn is a function type declaration matching the included SerializeBool function.
type BoolSizeFn ¶
BoolSizeFn is a function type declaration matching the included BoolSize function.
type BytesBufAppenderFn ¶ added in v1.1.0
BytesBufAppenderFn is a function type declaration matching the included AppendBytes function.
type BytesDeserializerFn ¶ added in v1.1.0
BytesDeserializerFn is a function type declaration matching the included DeserializeBytes function.
type BytesSerializerFn ¶ added in v1.1.0
BytesSerializerFn is a function type declaration matching the included SerializeBytes function.
type C128BufAppenderFn ¶
type C128BufAppenderFn = func(complex128, []byte, *tally.UTally) int
C128BufAppenderFn is a function type declaration matching the included AppendComplex128 function.
type C128DeserializerFn ¶
type C128DeserializerFn = func([]byte, *tally.UTally) (complex128, error)
C128DeserializerFn is a function type declaration matching the included DeserializeComplex128 function.
type C128SerializerFn ¶
type C128SerializerFn = func(complex128) []byte
C128SerializerFn is a function type declaration matching the included SerializeComplex128 function.
type C128SizeFn ¶
type C128SizeFn = func(complex128) uint
C128SizeFn is a function type declaration matching the included Complex128Size function.
type C64BufAppenderFn ¶
C64BufAppenderFn is a function type declaration matching the included AppendComplex64 function.
type C64DeserializerFn ¶
C64DeserializerFn is a function type declaration matching the included DeserializeComplex64 function.
type C64SerializerFn ¶
C64SerializerFn is a function type declaration matching the included SerializeComplex64 function.
type C64SizeFn ¶
C64SizeFn is a function type declaration matching the included Complex64Size function.
type Deserializable ¶
type F32BufAppenderFn ¶
F32BufAppenderFn is a function type declaration matching the included AppendFloat32 function.
type F32DeserializerFn ¶
F32DeserializerFn is a function type declaration matching the included DeserializeFloat32 function.
type F32SerializerFn ¶
F32SerializerFn is a function type declaration matching the included SerializeFloat32 function.
type F32SizeFn ¶
F32SizeFn is a function type declaration matching the included Float32Size function.
type F64BufAppenderFn ¶
F64BufAppenderFn is a function type declaration matching the included AppendFloat64 function.
type F64DeserializerFn ¶
F64DeserializerFn is a function type declaration matching the included DeserializeFloat64 function.
type F64SerializerFn ¶
F64SerializerFn is a function type declaration matching the included SerializeFloat64 function.
type F64SizeFn ¶
F64SizeFn is a function type declaration matching the included Float64Size function.
type I16BufAppenderFn ¶
I16BufAppenderFn is a function type declaration matching the included AppendInt16 function.
type I16DeserializerFn ¶
I16DeserializerFn is a function type declaration matching the included DeserializeInt16 function.
type I16SerializerFn ¶
I16SerializerFn is a function type declaration matching the included SerializeInt16 function.
type I32BufAppenderFn ¶
I32BufAppenderFn is a function type declaration matching the included AppendInt32 function.
type I32DeserializerFn ¶
I32DeserializerFn is a function type declaration matching the included DeserializeInt32 function.
type I32SerializerFn ¶
I32SerializerFn is a function type declaration matching the included SerializeInt32 function.
type I64BufAppenderFn ¶
I64BufAppenderFn is a function type declaration matching the included AppendInt64 function.
type I64DeserializerFn ¶
I64DeserializerFn is a function type declaration matching the included DeserializeInt64 function.
type I64SerializerFn ¶
I64SerializerFn is a function type declaration matching the included SerializeInt64 function.
type I8BufAppenderFn ¶
I8BufAppenderFn is a function type declaration matching the included AppendInt8 function.
type I8DeserializerFn ¶
I8DeserializerFn is a function type declaration matching the included DeserializeInt8 function.
type I8SerializerFn ¶
I8SerializerFn is a function type declaration matching the included SerializeInt8 function.
type IBufAppenderFn ¶
IBufAppenderFn is a function type declaration matching the included AppendInt function.
type IDeserializerFn ¶
IDeserializerFn is a function type declaration matching the included DeserializeInt function.
type ISerializerFn ¶
ISerializerFn is a function type declaration matching the included SerializeInt function.
type Serializable ¶
type StringBufAppenderFn ¶
StringBufAppenderFn is a function type declaration matching the included AppendString function.
type StringDeserializerFn ¶
StringDeserializerFn is a function type declaration matching the included DeserializeString function.
type StringSerializerFn ¶
StringSerializerFn is a function type declaration matching the included SerializeString function.
type U16BufAppenderFn ¶
U16BufAppenderFn is a function type declaration matching the included AppendUint16 function.
type U16DeserializerFn ¶
U16DeserializerFn is a function type declaration matching the included DeserializeUint16 function.
type U16SerializerFn ¶
U16SerializerFn is a function type declaration matching the included SerializeUint16 function.
type U16SizeFn ¶
U16SizeFn is a function type declaration matching the included Uint16Size function.
type U32BufAppenderFn ¶
U32BufAppenderFn is a function type declaration matching the included AppendUint32 function.
type U32DeserializerFn ¶
U32DeserializerFn is a function type declaration matching the included DeserializeUint32 function.
type U32SerializerFn ¶
U32SerializerFn is a function type declaration matching the included SerializeUint32 function.
type U32SizeFn ¶
U32SizeFn is a function type declaration matching the included Uint32Size function.
type U64BufAppenderFn ¶
U64BufAppenderFn is a function type declaration matching the included AppendUint64 function.
type U64DeserializerFn ¶
U64DeserializerFn is a function type declaration matching the included DeserializeUint64 function.
type U64SerializerFn ¶
U64SerializerFn is a function type declaration matching the included SerializeUint64 function.
type U64SizeFn ¶
U64SizeFn is a function type declaration matching the included Uint64Size function.
type U8BufAppenderFn ¶
U8BufAppenderFn is a function type declaration matching the included AppendUint8 function.
type U8DeserializerFn ¶
U8DeserializerFn is a function type declaration matching the included DeserializeUint8 function.
type U8SerializerFn ¶
U8SerializerFn is a function type declaration matching the included SerializeUint8 function.
type UBufAppenderFn ¶
UBufAppenderFn is a function type declaration matching the included AppendUint function.
type UDeserializerFn ¶
UDeserializerFn is a function type declaration matching the included DeserializeUint function.
type USerializerFn ¶
USerializerFn is a function type declaration matching the included SerializeUint function.