bits

package module
v0.0.0-...-4f1e2a0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2019 License: MIT Imports: 0 Imported by: 0

README

bits

A very simple helpers to manipulate bits in go, you can just copy the file.

  • Extract specific bit in a byte
  • Create a byte mask of contiguos bits for specific range
  • Extract a number represented in a range of bits

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateByteMask

func CreateByteMask(start, end uint8) (r byte)

CreateByteMask creates mask of consecutive bits from start to end index.

func GetBit

func GetBit(b byte, n uint8) uint8

GetBit extracts a specific bit in a byte.

Types

This section is empty.

Jump to

Keyboard shortcuts

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