bit

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: MIT Imports: 0 Imported by: 1

README

Bit

A simple library to work with bits in Go programming language.

This library allows to convert bytes to bits and bits to bytes.
Bits are stored in memory as separate objects.

The main purpose of this library is a tool for work with bits which allows to use bits as objects directly. It uses large amounts of memory while it stores each separate bit as boolean value.

This library is recommended for usage only for small amounts of data.

Documentation

Index

Constants

View Source
const (
	One  = Bit(true)
	Zero = Bit(false)
)
View Source
const BitsPerByte = 8

Variables

This section is empty.

Functions

func ConvertBitsToBytes

func ConvertBitsToBytes(bits []Bit) (result []byte, bitsCount int)

ConvertBitsToBytes converts the array of expectedBits into an array of bytes.

Types

type Bit

type Bit bool

func ConvertBytesToBits

func ConvertBytesToBits(bytes []byte) (result []Bit)

ConvertBytesToBits converts an array of bytes into an array of expectedBits. This function is optimized for speed.

Jump to

Keyboard shortcuts

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