utils

package
v0.0.0-...-ce13bd1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AverageV1

func AverageV1(low, high uint) uint

func AverageV2016

func AverageV2016(a, b uint) uint

AverageV2016 Average 2016 对两个无符号整数进行除法,同时通过 按位与 修正低位数字,保证两个证书都为奇数时,仍然正确

func GoID

func GoID() int

GoID 利用 runtime.Stack 的堆栈信息。`runtime.Stack(buf []byte, all bool) int` 将当前的堆栈信息写入到一个 slice 中, 堆栈的第一行为 `goroutine #### […` (如 goroutine 51 [running]:), 其中 `####` 就是当前的 goroutine ID。 获取堆栈信息会影响性能,所以建议在 debug 的时候才用 获取 goroutine ID

func Welcome

func Welcome()

Types

This section is empty.

Jump to

Keyboard shortcuts

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