sisyphus

package module
v0.0.5 Latest Latest
Warning

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

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

README

sisyphus

Go Reference

English · 繁体中文 · 简体中文

This is a project created by a beginner in Go language and a CTF novice, containing simple implementations of some algorithms and data structures. This project can also be used as a standalone library.

In our Go codebase, we adopt the suffix C to indicate that a function is designed for concurrent execution.

Contribution Guidelines

use goformat or goimport for code formatting

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntToChar added in v0.0.3

func IntToChar(arr []int) string

IntToChar Int 数组转换为 Char

func IsNumeric added in v0.0.5

func IsNumeric(s string) bool

isNumeric checks if a string contains only numeric characters. It iterates through each rune in the string and returns false 遍历检查字符串是否为仅数字

func Max added in v0.0.3

func Max[T Numeric](n ...T) (T, error)

Max 返回多个数字型中的最大值

func Min added in v0.0.3

func Min[T Numeric](n ...T) (T, error)

Min 返回多个数字型中的最小值

func PrintHexArr added in v0.0.3

func PrintHexArr(data []byte)

func ReversePrintArr added in v0.0.3

func ReversePrintArr(arr []string)

func ScoreByte added in v0.0.5

func ScoreByte(input []byte) (score float64, err error)

ScoreByte 根据英文字母频率计算 Bytes 分数

func ScoreStr added in v0.0.5

func ScoreStr(input string) (score float64, err error)

ScoreStr 根据英文字母频率计算 String 分数

func SliceReverse added in v0.0.3

func SliceReverse[T any](slice []T) []T

SliceReverse 翻转

func Xor added in v0.0.5

func Xor(a, b []byte) ([]byte, error)

Xor Go XOR

Types

type ColorLogHandler

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

ColorLogHandler defines a custom Handler to implement colorized output. 定义一个自定义 Handler 来实现彩色输出

func NewColorLogHandler

func NewColorLogHandler() *ColorLogHandler

NewColorLogHandler creates a new colorized log handler that outputs only to os.Stdout. 创建新的彩色日志处理器,输出固定到 os.Stdout

func (*ColorLogHandler) Enabled

func (h *ColorLogHandler) Enabled(ctx context.Context, level slog.Level) bool

Enabled checks if the given log level is enabled. 方法实现检查给定级别是否启用

func (*ColorLogHandler) Handle

func (h *ColorLogHandler) Handle(ctx context.Context, r slog.Record) error

Handle implements the custom log handling logic. 实现自定义的日志处理逻辑

func (*ColorLogHandler) WithAttrs

func (h *ColorLogHandler) WithAttrs(attrs []slog.Attr) slog.Handler

WithAttrs returns a new Handler with additional attributes. 方法实现返回附加属性的新 Handler

func (*ColorLogHandler) WithGroup

func (h *ColorLogHandler) WithGroup(name string) slog.Handler

WithGroup returns a new Handler with a log group name. WithGroup 方法实现返回带有日志组名称的新 Handler

type Comparable added in v0.0.3

type Comparable interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~float32 | ~float64 |
		~string
}

type Numeric added in v0.0.3

type Numeric interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~float32 | ~float64
}

type Pair

type Pair[T1 any, T2 any] struct {
	First  T1
	Second T2
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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