strength

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Key strength is unknown.
	KeyStrength_Unknown uint32 = 0x00

	// Key strength is weak.
	KeyStrength_Weak uint32 = 0x01

	// Key strength is normal.
	KeyStrength_Normal uint32 = 0x02
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyStrength

type KeyStrength struct {
	Name  string
	Value uint32

	// Internal
	RawBytes     []byte
	RawBytesSize uint32
}

KeyStrength specifies the strength of the NGC key. See: https://msdn.microsoft.com/en-us/library/mt220496.aspx

func (*KeyStrength) Marshal

func (ks *KeyStrength) Marshal() ([]byte, error)

Marshal returns the raw bytes of the KeyStrength structure.

Returns: - A byte slice representing the raw bytes of the KeyStrength structure. - An error if the conversion fails.

func (*KeyStrength) Unmarshal

func (ks *KeyStrength) Unmarshal(data []byte) (int, error)

Unmarshal parses the provided byte slice into the KeyStrength structure.

Parameters: - value: A byte slice containing the raw key strength to be parsed.

Returns: - The number of bytes read from the data. - An error if the parsing fails, otherwise nil.

Note: The function expects the byte slice to contain a 4-byte unsigned integer representing the key strength. It extracts the key strength value from the byte slice and assigns it to the KeyStrength structure.

Jump to

Keyboard shortcuts

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