Skip to main content
Extremely Popular
Latest
class Bitfield
import { Bitfield } from "https://deno.land/x/mongo@v0.33.0/src/utils/saslprep/sparse_bitfield.ts";

A class representation of a bitfield.

Constructors

new
Bitfield(opts?: Uint8Array | BitfieldOptions)

Creates a bitfield instance.

Properties

private
_pageMask: number
private
_trackUpdates: boolean
byteLength: number
length: number
readonly
pageOffset: number
readonly
pages: Pager
readonly
pageSize: number

Methods

get(i: number): boolean

Gets a bit.

getByte(i: number): number

Gets a byte.

set(i: number, v: boolean): boolean

Sets a bit.

setByte(i: number, b: number): boolean

Sets a byte.

toBuffer(): Uint8Array

Gets a single buffer representing the entire bitfield.