kmiputil

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidHexString = merry.New("invalid hex string")

Functions

func DecodeUint32

func DecodeUint32(b []byte) uint32

func DecodeUint64

func DecodeUint64(b []byte) uint64

func NormalizeName

func NormalizeName(s string) string

NormalizeName converts a string into the CamelCase format required for the XML and JSON encoding of KMIP values. It should be used for tag names, type names, and enumeration value names. Implementation of 5.4.1.1 and 5.5.1.1 from the KMIP Profiles specification.

func ParseHexValue

func ParseHexValue(s string, max int) ([]byte, error)

ParseHexValue attempts to parse a string formatted as a hex value as described in the KMIP Profiles spec, in the "Hex representations" section.

If the string doesn't start with the required prefix "0x", it is assumed the string is not a hex representation, and nil, nil is returned.

An ErrInvalidHexString is returned if the hex parsing fails. If the max argument is >0, ErrInvalidHexString is returned if the number of bytes parsed is greater than max, ignoring leading zeros. All bytes parsed are returned (including leading zeros).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL