bits

package module
v0.0.0-...-2a644cb Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package bits 提供位操作相关的逻辑

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear[T constraints.Unsigned](orig T, offsets ...int) T

Clear 按偏移量清除位

func HasAll

func HasAll[T constraints.Unsigned](b T, offsets ...int) bool

HasAll 返回指定的位是否全部一个置位了

func HasAny

func HasAny[T constraints.Unsigned](b T, offsets ...int) bool

HasAny 返回指定的位是否有任何一个置位了

func New32

func New32[T ~uint32](offsetsToSet ...int) T

New32 初始化一个 uint32 的位掩码

func New64

func New64[T ~uint64](offsetsToSet ...int) T

New64 初始化一个 uint64 的位掩码

func Set

func Set[T constraints.Unsigned](orig T, offsets ...int) T

Set 按偏移量设置位

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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