Documentation ¶
Overview ¶
Package hextype defines a custom format for hexadecimal numbers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HexFormat = gen.CustomFormat[ int64, JSONHexEncoding, TextHexEncoding, ]()
HexFormat defines a custom format for hexadecimal numbers.
Functions ¶
This section is empty.
Types ¶
type JSONHexEncoding ¶
type JSONHexEncoding struct{}
JSONHexEncoding defines a custom JSON encoding for hexadecimal numbers.
func (JSONHexEncoding) DecodeJSON ¶
func (JSONHexEncoding) DecodeJSON(d *jx.Decoder) (v int64, _ error)
DecodeJSON decodes a hexadecimal number from a JSON string.
func (JSONHexEncoding) EncodeJSON ¶
func (JSONHexEncoding) EncodeJSON(e *jx.Encoder, v int64)
EncodeJSON encodes a hexadecimal number as a JSON string.
type TextHexEncoding ¶
type TextHexEncoding struct{}
TextHexEncoding defines a custom text encoding for hexadecimal numbers.
func (TextHexEncoding) DecodeText ¶
func (TextHexEncoding) DecodeText(s string) (v int64, _ error)
DecodeText decodes a hexadecimal number from a string.
func (TextHexEncoding) EncodeText ¶
func (TextHexEncoding) EncodeText(v int64) string
EncodeText encodes a hexadecimal number as a string.
Click to show internal directories.
Click to hide internal directories.