util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESCbcDecrypt

func AESCbcDecrypt(ciphertext []byte, password string) []byte

func AESCbcEncrypt

func AESCbcEncrypt(str, password string) []byte

func Bcrypt

func Bcrypt(str string) string

func CheckBcrypt

func CheckBcrypt(hashStr, str string) bool

func InStringArray

func InStringArray(s string, ss []string) bool

func IoCopy

func IoCopy(dst io.Writer, src io.Reader) error

func ParsePtyRequest

func ParsePtyRequest(s []byte) (width, height int, ok bool)

ParsePtyRequest parses the payload of the pty-req message and extracts the dimensions of the terminal. See RFC 4254, section 6.2.

func ParseWinchRequest

func ParseWinchRequest(s []byte) (width, height int, ok bool)

func PtyReq

func PtyReq(w, h uint32, modes ...ssh.TerminalModes) []byte

func RandBytes

func RandBytes(c int) []byte

func SHA256

func SHA256(data []byte) []byte

func SendPtyReq

func SendPtyReq(chann ssh.Channel, w, h uint32, modes ...ssh.TerminalModes) error

func String

func String(str *string) string

Types

type PtyRequestMsg

type PtyRequestMsg struct {
	Term     string
	Columns  uint32
	Rows     uint32
	Width    uint32
	Height   uint32
	Modelist string
}

RFC 4254 Section 6.2.

type RW

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

func NewRW

func NewRW(r io.Reader, w io.Writer) *RW

func (*RW) Read

func (r *RW) Read(p []byte) (int, error)

func (*RW) Write

func (r *RW) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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