Documentation ¶
Overview ¶
Package per is implementation for Basic Pckage Encoding Rule (PER) in ALIGNED variant. document version: T-REC-X.691-201508
Index ¶
- Variables
- func DecLengthDeterminant(pdu *[]byte, max int) (length int, err error)
- func EncNonNegativeBinaryInteger(input uint) (v []byte, err error)
- type BitField
- func EncBitString(input []byte, inputlen, min, max int, extmark bool) (bf BitField, v []byte, err error)
- func EncChoice(input, min, max int, extmark bool) (bf BitField, v []byte, err error)
- func EncConstrainedWholeNumber(input, min, max int64) (bf BitField, err error)
- func EncEnumerated(input, min, max uint, extmark bool) (bf BitField, v []byte, err error)
- func EncInteger(input, min, max int64, extmark bool) (bf BitField, v []byte, err error)
- func EncLengthDeterminant(input, min, max int) (bf BitField, err error)
- func EncOctetString(input []byte, min, max int, extmark bool) (bf BitField, v []byte, err error)
- func EncSequence(extmark bool, optnum int, optflag uint) (b BitField, err error)
- func MergeBitField(in1 BitField, in2 BitField) (out BitField)
- func ShiftLeft(in BitField, shiftlen int) (out BitField)
- func ShiftLeftMost(in BitField) (out BitField)
- func ShiftRight(in BitField, shiftlen int) (out BitField)
Constants ¶
This section is empty.
Variables ¶
var EncSequenceOf = EncEnumerated
EncSequenceOf return Sequence-Of Preamble. 20. Encoding the sequence-of type
Functions ¶
func EncNonNegativeBinaryInteger ¶
EncNonNegativeBinaryInteger is the implementation for 11.3 Encoding as a non-negative-binary-integer
Types ¶
type BitField ¶
func EncBitString ¶
func EncBitString(input []byte, inputlen, min, max int, extmark bool) ( bf BitField, v []byte, err error)
EncBitString returns multi-byte BIT STRING 16. Encoding the bitstering type
func EncConstrainedWholeNumber ¶
EncConstrainedWholeNumber is the implementation for 11.5 Encoding of constrained whole number.
func EncEnumerated ¶
EncEnumerated is the implementation for 14. Encoding the enumerated type
func EncInteger ¶
EncInteger is the implementation for 13. Encoding the integer type but it is only for the case of single value and constrained whole nuber.
func EncLengthDeterminant ¶
EncLengthDeterminant is the implementation for 11.9 General rules for encoding a length determinant
func EncOctetString ¶
EncOctetString returns multi-byte OCTET STRING 17. Encoding the octetstring type
- the length of returned value can be calculated by len().
- returned value can be len(value) == 0 if the specified octet string has fixed length and the lenght is less than 3. And then the octet string is encoded as bit field.
func EncSequence ¶
EncSequence return Sequence Preamble but it just returns 0x00 for now. 19. Encoding the sequence type
func MergeBitField ¶
MergeBitField is utility function for merging bit-field. e.g. preamble or short integer value is not octet alined value, so those fields need to be packed in same octets.
func ShiftLeftMost ¶
ShiftLeftMost is utility function to shift the octet values to the leftmost.
func ShiftRight ¶
ShiftRight is utility function to right shift the octet values.