Skip to content

Home / node / Commands / classes / BitOffset @valkey/valkey-glide


@valkey/valkey-glide / Commands / BitOffset

Class: BitOffset

Represents an offset in an array of bits for the bitfield or bitfieldReadOnly commands.

For example, if we have the binary 01101001 with offset of 1 for an unsigned encoding of size 4, then the value is 13 from 0(1101)001.

Implements

Constructors

Constructor

new BitOffset(offset): BitOffset

Creates an instance of BitOffset.

Parameters

offset

number

The bit index offset in the array of bits. Must be greater than or equal to 0.

Returns

BitOffset

Methods

toArg()

toArg(): string

Returns the offset as a string argument to be used in the bitfield or bitfieldReadOnly commands.

Returns

string

The offset as a string argument.

Implementation of

BitFieldOffset.toArg