utils

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const RFC3339NoTimezone = "2006-01-02T15:04:05.999999999"

Variables

View Source
var (
	ErrSidToShort          = errors.New("binary sid too short")
	ErrSidLengthUnexpected = errors.New("binary sid length unexpected")
)

Functions

func BitmapToString

func BitmapToString(bitmap uint64) string

func ConvertBytesToStringUTF16 added in v0.6.0

func ConvertBytesToStringUTF16(b []byte) (string, error)

func Hexdump

func Hexdump(data []byte, lineLength int) string

Hexdump converst the byte array into an ascii hex dump with lineLength elements per line

func ParseWindowsTimestamp added in v0.6.0

func ParseWindowsTimestamp(s string) (*time.Time, error)

func TimeFromFILETIME

func TimeFromFILETIME(filetime uint64) time.Time

func TimeFromTSTime

func TimeFromTSTime(gen *generated.Tstime, tz *time.Location) time.Time

TimeFromTSTime turns a generated TSTime object into a Golang time.Time. tz must be set to the Timezone of the TSTime object, otherwise the de-localization returns objects in the wrong timezone.

func UuidFromMemory

func UuidFromMemory(raw []byte) (uuid.UUID, error)

Types

type Duration

type Duration struct {
	time.Duration
}

time.Duration does not support JSON marshalling; hence, we need a wrapper which implements it

func DurationFromTSTimePeriod

func DurationFromTSTimePeriod(gen *generated.Tstimeperiod) Duration

func SecondsToDuration

func SecondsToDuration(nsec uint32) Duration

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

type SID

type SID struct {
	RevisionLevel     uint8
	SubAuthorityCount int
	Authority         uint64
	SubAuthorities    []uint
}

func SidFromBytes

func SidFromBytes(b []byte) (*SID, error)

func (SID) MarshalText

func (s SID) MarshalText() ([]byte, error)

func (SID) RID

func (sid SID) RID() uint

func (SID) String

func (sid SID) String() string

Jump to

Keyboard shortcuts

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