core

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package asn1 --- 辅助读取ASN1结构的数据

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HMAC_MD5

func HMAC_MD5(key, data []byte) []byte

func If

func If[T any](cond bool, a, b T) T

func LMOWFv2

func LMOWFv2(password, user, domain string) []byte

LMOWFv2 Same as NTOWFv2

func MD4

func MD4(data []byte) []byte

func NTOWFv2

func NTOWFv2(password, user, domain string) []byte

NTOWFv2 Version 2 of NTLM hash function

func Random

func Random(size int) []byte

func RandomString

func RandomString(size int) string

func ReadBE

func ReadBE[T any](r io.Reader, data T) T

func ReadBytes

func ReadBytes(r io.Reader, length int) []byte

func ReadFull

func ReadFull(r io.Reader, data []byte) []byte

func ReadLE

func ReadLE[T any](r io.Reader, data T) T

func ShowHex

func ShowHex(data []byte)

func ShowLine

func ShowLine(line []byte)

func Throw

func Throw(e any)

func ThrowError

func ThrowError(e any)

func ThrowIf

func ThrowIf(cond bool, e any)

func ThrowNil

func ThrowNil(e any)

func Throwf

func Throwf(format string, args ...any)

func ToBE

func ToBE[T any](o T) []byte

func ToLE

func ToLE[T any](o T) []byte

func Try

func Try(f func()) error

func TryCatch

func TryCatch(f func(), catch func(e any))

func UnicodeEncode

func UnicodeEncode(p string) []byte

UnicodeEncode s.encode('utf-16le')

func WriteBE

func WriteBE[T any](w io.Writer, data T)

func WriteFull

func WriteFull(w io.Writer, data []byte)

func WriteLE

func WriteLE[T any](w io.Writer, data T)

Types

type Asn1

type Asn1 struct {
	Tag    uint8
	Length int
	Value  []byte
	// contains filtered or unexported fields
}

Asn1 https://www.ietf.org/rfc/rfc6025.html

func (*Asn1) Read

func (s *Asn1) Read(r io.Reader) []byte

func (*Asn1) Serialize

func (s *Asn1) Serialize() []byte

type Stream

type Stream struct {
	// contains filtered or unexported fields
}

func NewStream

func NewStream(addr string, tmOut time.Duration) *Stream

func (*Stream) Close

func (s *Stream) Close()

func (*Stream) Peek

func (s *Stream) Peek(n int) []byte

func (*Stream) PubKey

func (s *Stream) PubKey() []byte

func (*Stream) Read

func (s *Stream) Read(b []byte) (n int, err error)

func (*Stream) SwitchSSL

func (s *Stream) SwitchSSL()

func (*Stream) Write

func (s *Stream) Write(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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