Documentation ¶
Index ¶
- Constants
- type Base16Encoding
- type BaseXEncoding
- type CryptRandReader
- type EncError
- type Encoder
- func NewEncoder() Encoder
- func NewEncoderBase16Std() Encoder
- func NewEncoderBase32Hex() Encoder
- func NewEncoderBase32Std() Encoder
- func NewEncoderBase36() Encoder
- func NewEncoderBase62() Encoder
- func NewEncoderBase64Std() Encoder
- func NewEncoderBase64Url() Encoder
- func NewEncoderBaseX(base int) Encoder
- func NewEncoderCustom(encoder Encoder) Encoder
- type Encoding
- type ID
- type Identifier
- type InternalError
- type MockEncoding
- type MockRandReader
- type Provider
- type Providing
- func (p Providing) Byte(id []byte) Identifier
- func (p Providing) Generate() (Identifier, error)
- func (p Providing) Int16(id []int16) Identifier
- func (p Providing) Int32(id []int32) Identifier
- func (p Providing) Int64(id []int64) Identifier
- func (p Providing) Parse(id string) (Identifier, error)
- func (p Providing) Uint16(id []uint16) Identifier
- func (p Providing) Uint32(id []uint32) Identifier
- func (p Providing) Uint64(id []uint64) Identifier
- type Rand
- type RandError
- type Randomizer
- type WrongSizeError
Constants ¶
View Source
const ErrorMsgSizeDivisible2 = "size of data must be divisible by 2"
View Source
const ErrorMsgSizeDivisible4 = "size of data must be divisible by 4"
View Source
const ErrorMsgSizeDivisible8 = "size of data must be divisible by 8"
View Source
const ErrorMsgWrongSizeZero = "size cannot be zero"
View Source
const SizeDefault uint32 = 20
View Source
const SizeInt16 = 2
View Source
const SizeInt32 = 4
View Source
const SizeInt64 = 8
View Source
const SizeUint16 = SizeInt16
View Source
const SizeUint32 = SizeInt32
View Source
const SizeUint64 = SizeInt64
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base16Encoding ¶
type Base16Encoding struct{}
func (Base16Encoding) DecodeString ¶
func (b Base16Encoding) DecodeString(s string) ([]byte, error)
func (Base16Encoding) EncodeToString ¶
func (b Base16Encoding) EncodeToString(src []byte) string
type BaseXEncoding ¶
type BaseXEncoding struct {
// contains filtered or unexported fields
}
func (BaseXEncoding) DecodeString ¶
func (b BaseXEncoding) DecodeString(s string) ([]byte, error)
func (BaseXEncoding) EncodeToString ¶
func (b BaseXEncoding) EncodeToString(src []byte) string
type CryptRandReader ¶
type CryptRandReader struct{}
type Encoder ¶
func NewEncoder ¶
func NewEncoder() Encoder
func NewEncoderBase16Std ¶
func NewEncoderBase16Std() Encoder
func NewEncoderBase32Hex ¶
func NewEncoderBase32Hex() Encoder
func NewEncoderBase32Std ¶
func NewEncoderBase32Std() Encoder
func NewEncoderBase36 ¶
func NewEncoderBase36() Encoder
func NewEncoderBase62 ¶
func NewEncoderBase62() Encoder
func NewEncoderBase64Std ¶
func NewEncoderBase64Std() Encoder
func NewEncoderBase64Url ¶
func NewEncoderBase64Url() Encoder
func NewEncoderBaseX ¶
func NewEncoderCustom ¶
type Identifier ¶
type Identifier interface { String() string Byte() []byte Int16() ([]int16, error) Uint16() ([]uint16, error) Int32() ([]int32, error) Uint32() ([]uint32, error) Int64() ([]int64, error) Uint64() ([]uint64, error) }
func NewID ¶
func NewID(data []byte, enc Encoder) Identifier
func NewIDStdBase32 ¶
func NewIDStdBase32(data []byte) Identifier
type InternalError ¶
type InternalError struct {
// contains filtered or unexported fields
}
type MockEncoding ¶
func (MockEncoding) DecodeString ¶
func (e MockEncoding) DecodeString(s string) ([]byte, error)
func (MockEncoding) EncodeToString ¶
func (e MockEncoding) EncodeToString(src []byte) string
type MockRandReader ¶
type Provider ¶
type Provider interface { Generate() (Identifier, error) Parse(id string) (Identifier, error) Byte(id []byte) Identifier Int16(id []int16) Identifier Uint16(id []uint16) Identifier Int32(id []int32) Identifier Uint32(id []uint32) Identifier Int64(id []int64) Identifier Uint64(id []uint64) Identifier }
func NewProvider ¶
func NewProvider() Provider
func NewProviderCustom ¶
func NewProviderCustom(size uint32, rand Randomizer, enc Encoder) Provider
func NewProviderSize ¶
type Providing ¶
type Providing struct {
// contains filtered or unexported fields
}
func (Providing) Byte ¶
func (p Providing) Byte(id []byte) Identifier
func (Providing) Generate ¶
func (p Providing) Generate() (Identifier, error)
func (Providing) Int16 ¶
func (p Providing) Int16(id []int16) Identifier
func (Providing) Int32 ¶
func (p Providing) Int32(id []int32) Identifier
func (Providing) Int64 ¶
func (p Providing) Int64(id []int64) Identifier
func (Providing) Uint16 ¶
func (p Providing) Uint16(id []uint16) Identifier
func (Providing) Uint32 ¶
func (p Providing) Uint32(id []uint32) Identifier
func (Providing) Uint64 ¶
func (p Providing) Uint64(id []uint64) Identifier
type Randomizer ¶
func NewRand ¶
func NewRand() Randomizer
func NewRandCustom ¶
func NewRandCustom(r io.Reader) Randomizer
type WrongSizeError ¶
type WrongSizeError struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.