dreamworkAPI
Ctrl K
GitHub
libraryDocs / bytepack

bytepack

librarysharedmenusource

Library that packs & unpacks types as bytes.

Classes & types

Functions

bytepack.readDateReads date in DOS format from single Short number ( UInt16 ).
bytepack.readDoubleBEReads signed 8-byte (64 bit) float (double) from big endian bytes.
bytepack.readDoubleLEReads signed 8-byte (64 bit) float (double) from little endian bytes.
bytepack.readFixedPointReads fixed-point number (UQm.n) from specified integer with n bits.
bytepack.readFloatBEReads signed 4-byte (32 bit) float from big endian bytes.
bytepack.readFloatLEReads signed 4-byte (32 bit) float from little endian bytes.
bytepack.readHex16BEReads unsigned 2-byte (16 bit) integer from big endian hex bytes.
bytepack.readHex24BEReads unsigned 3-byte (24 bit) integer from big endian hex bytes.
bytepack.readHex32BEReads unsigned 4-byte (32 bit) integer from big endian hex bytes.
bytepack.readHex8Reads unsigned 1-byte (8 bit) integer from big endian hex bytes.
bytepack.readInt16BEReads signed 2-byte (16 bit) integer as big endian bytes.
bytepack.readInt16LEReads signed 2-byte (16 bit) integer as little endian bytes.
bytepack.readInt24BEReads signed 3-byte (24 bit) integer as big endian bytes.
bytepack.readInt24LEReads signed 3-byte (24 bit) integer as little endian bytes.
bytepack.readInt32BEReads signed 4-byte (32 bit) integer from big endian bytes.
bytepack.readInt32LEReads signed 4-byte (32 bit) integer from little endian bytes.
bytepack.readInt40BEReads signed 5-byte (40 bit) integer from big endian bytes.
bytepack.readInt40LEReads signed 5-byte (40 bit) integer from little endian bytes.
bytepack.readInt48BEReads signed 6-byte (48 bit) integer from big endian bytes.
bytepack.readInt48LEReads signed 6-byte (48 bit) integer from little endian bytes.
bytepack.readInt56BEReads signed 7-byte (56 bit) integer from big endian bytes.
bytepack.readInt56LEReads signed 7-byte (56 bit) integer from little endian bytes.
bytepack.readInt64BEReads signed 8-byte (64 bit) integer from big endian bytes.
bytepack.readInt64LEReads signed 8-byte (64 bit) integer from little endian bytes.
bytepack.readInt8Reads signed 1-byte (8 bit) integer as little endian bytes.
bytepack.readTimeReads hours, minutes and seconds from single Short number ( UInt16 ).
bytepack.readUInt16BEReads unsigned 2-byte (16 bit) integer from big endian bytes.
bytepack.readUInt16LEReads unsigned 2-byte (16 bit) integer from little endian bytes.
bytepack.readUInt24BEReads unsigned 3-byte (24 bit) integer from big endian bytes.
bytepack.readUInt24LEReads unsigned 3-byte (24 bit) integer from little endian bytes.
bytepack.readUInt32BEReads unsigned 4-byte (32 bit) integer from big endian bytes.
bytepack.readUInt32LEReads unsigned 4-byte (32 bit) integer from little endian bytes.
bytepack.readUInt40BEReads unsigned 5-byte (40 bit) integer from big endian bytes.
bytepack.readUInt40LEReads unsigned 5-byte (40 bit) integer from little endian bytes.
bytepack.readUInt48BEReads unsigned 6-byte (48 bit) integer from big endian bytes.
bytepack.readUInt48LEReads unsigned 6-byte (48 bit) integer from little endian bytes.
bytepack.readUInt56BEReads unsigned 7-byte (56 bit) integer from big endian bytes.
bytepack.readUInt56LEReads unsigned 7-byte (56 bit) integer from little endian bytes.
bytepack.readUInt64BEReads unsigned 8-byte (64 bit) integer from big endian bytes.
bytepack.readUInt64LEReads unsigned 8-byte (64 bit) integer from little endian bytes.
bytepack.readUInt8Reads unsigned 1-byte (8 bit) integer from bytes.
bytepack.writeDateWrites date in DOS format as single Short number ( UInt16 ).
bytepack.writeDoubleBEWrites signed 8-byte (64 bit) float (double) as big endian bytes.
bytepack.writeDoubleLEWrites signed 8-byte (64 bit) float (double) as little endian bytes.
bytepack.writeFixedPointWrites fixed-point number (UQm.n or Qm.n) as integer with n fractional bits.
bytepack.writeFloatBEWrites signed 4-byte (32 bit) float as big endian bytes.
bytepack.writeFloatLEWrites signed 4-byte (32 bit) float as little endian bytes.
bytepack.writeHex16BEEncodes unsigned 2-byte (16 bit) integer to big endian hex bytes.
bytepack.writeHex16LEEncodes unsigned 2-byte (16 bit) integer to little endian hex bytes.
bytepack.writeHex24BEEncodes unsigned 3-byte (24 bit) integer to big endian hex bytes.
bytepack.writeHex24LEEncodes unsigned 3-byte (24 bit) integer to little endian hex bytes.
bytepack.writeHex32BEEncodes unsigned 4-byte (32 bit) integer to big endian hex bytes.
bytepack.writeHex32LEEncodes unsigned 4-byte (32 bit) integer to little endian hex bytes.
bytepack.writeHex8Encodes unsigned 1-byte (8 bit) integer to big endian hex bytes.
bytepack.writeInt16BEWrites signed 2-byte (16 bit) integer as big endian bytes.
bytepack.writeInt16LEWrites signed 2-byte (16 bit) integer as little endian bytes.
bytepack.writeInt24BEWrites signed 3-byte (24 bit) integer as big endian bytes.
bytepack.writeInt24LEWrites signed 3-byte (24 bit) integer as little endian bytes.
bytepack.writeInt32BEWrites signed 4-byte (32 bit) integer as big endian bytes.
bytepack.writeInt32LEWrites signed 4-byte (32 bit) integer as little endian bytes.
bytepack.writeInt40BEWrites signed 5-byte (40 bit) integer as big endian bytes.
bytepack.writeInt40LEWrites signed 5-byte (40 bit) integer as little endian bytes.
bytepack.writeInt48BEWrites signed 6-byte (48 bit) integer as big endian bytes.
bytepack.writeInt48LEWrites signed 6-byte (48 bit) integer as little endian bytes.
bytepack.writeInt56BEWrites signed 7-byte (56 bit) integer as big endian bytes.
bytepack.writeInt56LEWrites signed 7-byte (56 bit) integer as little endian bytes.
bytepack.writeInt64BEWrites signed 8-byte (64 bit) integer as big endian bytes.
bytepack.writeInt64LEWrites signed 8-byte (64 bit) integer as little endian bytes.
bytepack.writeInt8Writes signed 1-byte (8 bit) integer as little endian bytes.
bytepack.writeTimeWrites time in DOS format as single Short number ( UInt16 ).
bytepack.writeUInt16BEWrites unsigned 2-byte (16 bit) integer as big endian bytes.
bytepack.writeUInt16LEWrites unsigned 2-byte (16 bit) integer as little endian bytes.
bytepack.writeUInt24BEWrites unsigned 3-byte (24 bit) integer as big endian bytes.
bytepack.writeUInt24LEWrites unsigned 3-byte (24 bit) integer as little endian bytes.
bytepack.writeUInt32BEWrites unsigned 4-byte (32 bit) integer as big endian bytes.
bytepack.writeUInt32LEWrites unsigned 4-byte (32 bit) integer as little endian bytes.
bytepack.writeUInt40BEWrites unsigned 5-byte (40 bit) integer as big endian bytes.
bytepack.writeUInt40LEWrites unsigned 5-byte (40 bit) integer as little endian bytes.
bytepack.writeUInt48BEWrites unsigned 6-byte (48 bit) integer as big endian bytes.
bytepack.writeUInt48LEWrites unsigned 6-byte (48 bit) integer as little endian bytes.
bytepack.writeUInt56BEWrites unsigned 7-byte (56 bit) integer as big endian bytes.
bytepack.writeUInt56LEWrites unsigned 7-byte (56 bit) integer as little endian bytes.
bytepack.writeUInt64BEWrites unsigned 8-byte (64 bit) integer as big endian bytes.
bytepack.writeUInt64LEWrites unsigned 8-byte (64 bit) integer as little endian bytes.
bytepack.writeUInt8Writes unsigned 1-byte (8 bit) integer as bytes.

#bytepack.readDate

sharedmenunodiscardsource
function bytepack.readDate(uint16: integer): integer, integer, integer

Reads date in DOS format from single Short number ( UInt16 ).

Parameters
NameTypeDescription
uint16integerThe uint16 to read from.
Returns
TypeNameDescription
integerdayThe day.
integermonthThe month.
integeryearThe year.

#bytepack.readDoubleBE

sharedmenunodiscardsource
function bytepack.readDoubleBE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer, uint8_6: integer, uint8_7: integer, uint8_8: integer): number

Reads signed 8-byte (64 bit) float (double) from big endian bytes.

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
uint8_6integerThe sixth byte.
uint8_7integerThe seventh byte.
uint8_8integerThe eighth byte.
Returns
TypeNameDescription
numbervalueThe signed 8-byte float.

#bytepack.readDoubleLE

sharedmenunodiscardsource
function bytepack.readDoubleLE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer, uint8_6: integer, uint8_7: integer, uint8_8: integer): number

Reads signed 8-byte (64 bit) float (double) from little endian bytes.

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
uint8_6integerThe sixth byte.
uint8_7integerThe seventh byte.
uint8_8integerThe eighth byte.
Returns
TypeNameDescription
numbervalueThe signed 8-byte float.

#bytepack.readFixedPoint

sharedmenunodiscardsource
function bytepack.readFixedPoint(n: integer, integer: integer): number

Reads fixed-point number (UQm.n) from specified integer with n bits.

Commonly Used UQm.n Formats (unsigned)
FormatRangePrecision (Step)
UQ8.80 to 255.9960.00390625 (1/256)
UQ10.60 to 1023.9843750.015625 (1/64)
UQ12.40 to 4095.93750.0625 (1/16)
UQ16.160 to 65,535.999980.0000152588 (1/65536)
UQ24.80 to 16,777,215.9960.00390625 (1/256)
UQ32.160 to 4,294,967,295.999980.0000152588 (1/65536)
Commonly Used Qm.n Formats (signed)
FormatRangePrecision (Step)
Q8.8-128.0 to 127.9960.00390625 (1/256)
Q10.6-512.0 to 511.9843750.015625 (1/64)
Q12.4-2048.0 to 2047.93750.0625 (1/16)
Q16.16-32,768.0 to 32,767.999980.0000152588 (1/65536)
Q24.8-8,388,608.0 to 8,388,607.9960.00390625 (1/256)
Q32.16-2,147,483,648.0 to 2,147,483,647.999980.0000152588 (1/65536)
Parameters
NameTypeDescription
nintegerNumber of fractional bits.
integerintegerThe integer number to read from.
Returns
TypeNameDescription
numbervalueThe unsigned fixed-point number.

#bytepack.readFloatBE

sharedmenunodiscardsource
function bytepack.readFloatBE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer): number

Reads signed 4-byte (32 bit) float from big endian bytes.

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
Returns
TypeNameDescription
numbervalueThe signed 4-byte float.

#bytepack.readFloatLE

sharedmenunodiscardsource
function bytepack.readFloatLE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer): number

Reads signed 4-byte (32 bit) float from little endian bytes.

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
Returns
TypeNameDescription
numbervalueThe signed 4-byte float.

#bytepack.readHex16BE

sharedmenunodiscardsource
function bytepack.readHex16BE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer): integer | nil

Reads unsigned 2-byte (16 bit) integer from big endian hex bytes.

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
Returns
TypeNameDescription
integer | nilvalueThe unsigned 2-byte integer or nil if bytes do not match the allowed ones.

#bytepack.readHex24BE

sharedmenunodiscardsource
function bytepack.readHex24BE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer, uint8_6: integer): integer | nil

Reads unsigned 3-byte (24 bit) integer from big endian hex bytes.

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
uint8_6integerThe sixth byte.
Returns
TypeNameDescription
integer | nilvalueThe unsigned 3-byte integer or nil if bytes do not match the allowed ones.

#bytepack.readHex32BE

sharedmenunodiscardsource
function bytepack.readHex32BE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer, uint8_6: integer, uint8_7: integer, uint8_8: integer): integer | nil

Reads unsigned 4-byte (32 bit) integer from big endian hex bytes.

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
uint8_6integerThe sixth byte.
uint8_7integerThe seventh byte.
uint8_8integerThe eighth byte.
Returns
TypeNameDescription
integer | nilvalueThe unsigned 4-byte integer or nil if bytes do not match the allowed ones.

#bytepack.readHex8

sharedmenunodiscardsource
function bytepack.readHex8(uint8_1: integer, uint8_2: integer): integer | nil

Reads unsigned 1-byte (8 bit) integer from big endian hex bytes.

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
Returns
TypeNameDescription
integer | nilvalueThe unsigned 1-byte integer or nil if bytes do not match the allowed ones.

#bytepack.readInt16BE

sharedmenunodiscardsource
function bytepack.readInt16BE(uint8_1: integer, uint8_2: integer): integer

Reads signed 2-byte (16 bit) integer as big endian bytes.

Valid values without loss of precision: -32768 - 32767

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
Returns
TypeNameDescription
integervalueThe signed 2-byte integer.

#bytepack.readInt16LE

sharedmenunodiscardsource
function bytepack.readInt16LE(uint8_1: integer, uint8_2: integer): integer

Reads signed 2-byte (16 bit) integer as little endian bytes.

Valid values without loss of precision: -32768 - 32767

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
Returns
TypeNameDescription
integervalueThe signed 2-byte integer.

#bytepack.readInt24BE

sharedmenunodiscardsource
function bytepack.readInt24BE(uint8_1: integer, uint8_2: integer, uint8_3: integer): integer

Reads signed 3-byte (24 bit) integer as big endian bytes.

Valid values without loss of precision: -8388608 - 8388607

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
Returns
TypeNameDescription
integervalueThe signed 3-byte integer.

#bytepack.readInt24LE

sharedmenunodiscardsource
function bytepack.readInt24LE(uint8_1: integer, uint8_2: integer, uint8_3: integer): integer

Reads signed 3-byte (24 bit) integer as little endian bytes.

Valid values without loss of precision: -8388608 - 8388607

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
Returns
TypeNameDescription
integervalueThe signed 3-byte integer.

#bytepack.readInt32BE

sharedmenunodiscardsource
function bytepack.readInt32BE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer): integer

Reads signed 4-byte (32 bit) integer from big endian bytes.

Valid values without loss of precision: -2147483648 - 2147483647

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
Returns
TypeNameDescription
integervalueThe signed 4-byte integer.

#bytepack.readInt32LE

sharedmenunodiscardsource
function bytepack.readInt32LE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer): integer

Reads signed 4-byte (32 bit) integer from little endian bytes.

Valid values without loss of precision: -2147483648 - 2147483647

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
Returns
TypeNameDescription
integervalueThe signed 4-byte integer.

#bytepack.readInt40BE

sharedmenunodiscardsource
function bytepack.readInt40BE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer): integer

Reads signed 5-byte (40 bit) integer from big endian bytes.

Valid values without loss of precision: -549755813888 - 549755813887

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
Returns
TypeNameDescription
integervalueThe signed 5-byte integer.

#bytepack.readInt40LE

sharedmenunodiscardsource
function bytepack.readInt40LE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer): integer

Reads signed 5-byte (40 bit) integer from little endian bytes.

Valid values without loss of precision: -549755813888 - 549755813887

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
Returns
TypeNameDescription
integervalueThe signed 5-byte integer.

#bytepack.readInt48BE

sharedmenunodiscardsource
function bytepack.readInt48BE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer, uint8_6: integer): integer

Reads signed 6-byte (48 bit) integer from big endian bytes.

Valid values without loss of precision: -140737488355328 - 140737488355327

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
uint8_6integerThe sixth byte.
Returns
TypeNameDescription
integervalueThe signed 6-byte integer.

#bytepack.readInt48LE

sharedmenunodiscardsource
function bytepack.readInt48LE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer, uint8_6: integer): integer

Reads signed 6-byte (48 bit) integer from little endian bytes.

Valid values without loss of precision: -140737488355328 - 140737488355327

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
uint8_6integerThe sixth byte.
Returns
TypeNameDescription
integervalueThe signed 6-byte integer.

#bytepack.readInt56BE

sharedmenunodiscardsource
function bytepack.readInt56BE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer, uint8_6: integer, uint8_7: integer): integer

Reads signed 7-byte (56 bit) integer from big endian bytes.

Valid values without loss of precision: -36028797018963968 - 36028797018963967

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
uint8_6integerThe sixth byte.
uint8_7integerThe seventh byte.
Returns
TypeNameDescription
integervalueThe signed 7-byte integer.

#bytepack.readInt56LE

sharedmenunodiscardsource
function bytepack.readInt56LE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer, uint8_6: integer, uint8_7: integer): integer

Reads signed 7-byte (56 bit) integer from little endian bytes.

Valid values without loss of precision: -36028797018963968 - 36028797018963967

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
uint8_6integerThe sixth byte.
uint8_7integerThe seventh byte.
Returns
TypeNameDescription
integervalueThe signed 7-byte integer.

#bytepack.readInt64BE

sharedmenunodiscardsource
function bytepack.readInt64BE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer, uint8_6: integer, uint8_7: integer, uint8_8: integer): integer

Reads signed 8-byte (64 bit) integer from big endian bytes.

Valid values without loss of precision: -9007199254740991 - 9007199254740991

All values above will have problems when working with them.

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
uint8_6integerThe sixth byte.
uint8_7integerThe seventh byte.
uint8_8integerThe eighth byte.
Returns
TypeNameDescription
integervalueThe signed 8-byte integer.

#bytepack.readInt64LE

sharedmenunodiscardsource
function bytepack.readInt64LE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer, uint8_6: integer, uint8_7: integer, uint8_8: integer): integer

Reads signed 8-byte (64 bit) integer from little endian bytes.

Valid values without loss of precision: -9007199254740991 - 9007199254740991

All values above will have problems when working with them.

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
uint8_6integerThe sixth byte.
uint8_7integerThe seventh byte.
uint8_8integerThe eighth byte.
Returns
TypeNameDescription
integervalueThe signed 8-byte integer.

#bytepack.readInt8

sharedmenunodiscardsource
function bytepack.readInt8(uint8_1: integer): integer

Reads signed 1-byte (8 bit) integer as little endian bytes.

Valid values without loss of precision: -128 - 127

Parameters
NameTypeDescription
uint8_1integerThe byte.
Returns
TypeNameDescription
integervalueThe signed 1-byte integer.

#bytepack.readTime

sharedmenunodiscardsource
function bytepack.readTime(uint16: integer): integer, integer, integer

Reads hours, minutes and seconds from single Short number ( UInt16 ).

Parameters
NameTypeDescription
uint16integerThe uint16 to read from.
Returns
TypeNameDescription
integerhoursThe number of hours.
integerminutesThe number of minutes.
integersecondsThe number of seconds, will be rounded.

#bytepack.readUInt16BE

sharedmenunodiscardsource
function bytepack.readUInt16BE(uint8_1: integer, uint8_2: integer): integer

Reads unsigned 2-byte (16 bit) integer from big endian bytes.

Valid values without loss of precision: 0 - 65535

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
Returns
TypeNameDescription
integervalueThe unsigned 2-byte integer.

#bytepack.readUInt16LE

sharedmenunodiscardsource
function bytepack.readUInt16LE(uint8_1: integer, uint8_2: integer): integer

Reads unsigned 2-byte (16 bit) integer from little endian bytes.

Valid values without loss of precision: 0 - 65535

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
Returns
TypeNameDescription
integervalueThe unsigned 2-byte integer.

#bytepack.readUInt24BE

sharedmenunodiscardsource
function bytepack.readUInt24BE(uint8_1: integer, uint8_2: integer, uint8_3: integer): integer

Reads unsigned 3-byte (24 bit) integer from big endian bytes.

Valid values without loss of precision: 0 - 16777215

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
Returns
TypeNameDescription
integervalueThe unsigned 3-byte integer.

#bytepack.readUInt24LE

sharedmenunodiscardsource
function bytepack.readUInt24LE(uint8_1: integer, uint8_2: integer, uint8_3: integer): integer

Reads unsigned 3-byte (24 bit) integer from little endian bytes.

Valid values without loss of precision: 0 - 16777215

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
Returns
TypeNameDescription
integervalueThe unsigned 3-byte integer.

#bytepack.readUInt32BE

sharedmenunodiscardsource
function bytepack.readUInt32BE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer): integer

Reads unsigned 4-byte (32 bit) integer from big endian bytes.

Valid values without loss of precision: 0 - 4294967295

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
Returns
TypeNameDescription
integervalueThe unsigned 4-byte integer.

#bytepack.readUInt32LE

sharedmenunodiscardsource
function bytepack.readUInt32LE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer): integer

Reads unsigned 4-byte (32 bit) integer from little endian bytes.

Valid values without loss of precision: 0 - 4294967295

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
Returns
TypeNameDescription
integervalueThe unsigned 4-byte integer.

#bytepack.readUInt40BE

sharedmenunodiscardsource
function bytepack.readUInt40BE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer): integer

Reads unsigned 5-byte (40 bit) integer from big endian bytes.

Valid values without loss of precision: 0 - 1099511627775

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
Returns
TypeNameDescription
integervalueThe unsigned 5-byte integer.

#bytepack.readUInt40LE

sharedmenunodiscardsource
function bytepack.readUInt40LE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer): integer

Reads unsigned 5-byte (40 bit) integer from little endian bytes.

Valid values without loss of precision: 0 - 1099511627775

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
Returns
TypeNameDescription
integervalueThe unsigned 5-byte integer.

#bytepack.readUInt48BE

sharedmenunodiscardsource
function bytepack.readUInt48BE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer, uint8_6: integer): integer

Reads unsigned 6-byte (48 bit) integer from big endian bytes.

Valid values without loss of precision: 0 - 281474976710655

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
uint8_6integerThe sixth byte.
Returns
TypeNameDescription
integervalueThe unsigned 6-byte integer.

#bytepack.readUInt48LE

sharedmenunodiscardsource
function bytepack.readUInt48LE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer, uint8_6: integer): integer

Reads unsigned 6-byte (48 bit) integer from little endian bytes.

Valid values without loss of precision: 0 - 281474976710655

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
uint8_6integerThe sixth byte.
Returns
TypeNameDescription
integervalueThe unsigned 6-byte integer.

#bytepack.readUInt56BE

sharedmenunodiscardsource
function bytepack.readUInt56BE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer, uint8_6: integer, uint8_7: integer): integer

Reads unsigned 7-byte (56 bit) integer from big endian bytes.

Valid values without loss of precision: 0 - 9007199254740991

All values above will have problems when working with them.

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
uint8_6integerThe sixth byte.
uint8_7integerThe seventh byte.
Returns
TypeNameDescription
integervalueThe unsigned 7-byte integer.

#bytepack.readUInt56LE

sharedmenunodiscardsource
function bytepack.readUInt56LE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer, uint8_6: integer, uint8_7: integer): integer

Reads unsigned 7-byte (56 bit) integer from little endian bytes.

Valid values without loss of precision: 0 - 9007199254740991

All values above will have problems when working with them.

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
uint8_6integerThe sixth byte.
uint8_7integerThe seventh byte.
Returns
TypeNameDescription
integervalueThe unsigned 7-byte integer.

#bytepack.readUInt64BE

sharedmenunodiscardsource
function bytepack.readUInt64BE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer, uint8_6: integer, uint8_7: integer, uint8_8: integer): integer

Reads unsigned 8-byte (64 bit) integer from big endian bytes.

Valid values without loss of precision: 0 - 9007199254740991

All values above will have problems when working with them.

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
uint8_6integerThe sixth byte.
uint8_7integerThe seventh byte.
uint8_8integerThe eighth byte.
Returns
TypeNameDescription
integervalueThe unsigned 8-byte integer.

#bytepack.readUInt64LE

sharedmenunodiscardsource
function bytepack.readUInt64LE(uint8_1: integer, uint8_2: integer, uint8_3: integer, uint8_4: integer, uint8_5: integer, uint8_6: integer, uint8_7: integer, uint8_8: integer): integer

Reads unsigned 8-byte (64 bit) integer from little endian bytes.

Valid values without loss of precision: 0 - 9007199254740991

All values above will have problems when working with them.

Parameters
NameTypeDescription
uint8_1integerThe first byte.
uint8_2integerThe second byte.
uint8_3integerThe third byte.
uint8_4integerThe fourth byte.
uint8_5integerThe fifth byte.
uint8_6integerThe sixth byte.
uint8_7integerThe seventh byte.
uint8_8integerThe eighth byte.
Returns
TypeNameDescription
integervalueThe unsigned 8-byte integer.

#bytepack.readUInt8

sharedmenunodiscardsource
function bytepack.readUInt8(uint8_1: integer): integer

Reads unsigned 1-byte (8 bit) integer from bytes.

Valid values without loss of precision: 0 - 255

Parameters
NameTypeDescription
uint8_1integerThe byte.
Returns
TypeNameDescription
integervalueThe unsigned 1-byte integer.

#bytepack.writeDate

sharedmenunodiscardsource
function bytepack.writeDate(day?: integer, month?: integer, year?: integer): integer

Writes date in DOS format as single Short number ( UInt16 ).

Parameters
NameTypeDescription
dayoptionalintegerThe day.
monthoptionalintegerThe month.
yearoptionalintegerThe year.
Returns
TypeNameDescription
integeruint16The uint16 to read from.

#bytepack.writeDoubleBE

sharedmenunodiscardsource
function bytepack.writeDoubleBE(value: number): integer, integer, integer, integer, integer, integer, integer, integer

Writes signed 8-byte (64 bit) float (double) as big endian bytes.

Parameters
NameTypeDescription
valuenumberThe signed 8-byte float.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.
integeruint8_7The seventh byte.
integeruint8_8The eighth byte.

#bytepack.writeDoubleLE

sharedmenunodiscardsource
function bytepack.writeDoubleLE(value: number): integer, integer, integer, integer, integer, integer, integer, integer

Writes signed 8-byte (64 bit) float (double) as little endian bytes.

Parameters
NameTypeDescription
valuenumberThe signed 8-byte float.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.
integeruint8_7The seventh byte.
integeruint8_8The eighth byte.

#bytepack.writeFixedPoint

sharedmenunodiscardsource
function bytepack.writeFixedPoint(value: number, m: integer, n: integer): integer

Writes fixed-point number (UQm.n or Qm.n) as integer with n fractional bits.

The value is rounded to the nearest representable step.

Commonly Used UQm.n Formats
FormatRangePrecision (Step)
UQ8.80 to 255.9960.00390625 (1/256)
UQ10.60 to 1023.9843750.015625 (1/64)
UQ12.40 to 4095.93750.0625 (1/16)
UQ16.160 to 65,535.999980.0000152588 (1/65536)
UQ24.80 to 16,777,215.9960.00390625 (1/256)
UQ32.160 to 4,294,967,295.999980.0000152588 (1/65536)
Commonly Used Qm.n Formats (signed)
FormatRangePrecision (Step)
Q8.8-128.0 to 127.9960.00390625 (1/256)
Q10.6-512.0 to 511.9843750.015625 (1/64)
Q12.4-2048.0 to 2047.93750.0625 (1/16)
Q16.16-32,768.0 to 32,767.999980.0000152588 (1/65536)
Q24.8-8,388,608.0 to 8,388,607.9960.00390625 (1/256)
Q32.16-2,147,483,648.0 to 2,147,483,647.999980.0000152588 (1/65536)
Parameters
NameTypeDescription
valuenumberThe fixed-point number.
mintegerNumber of integer bits (including sign bit).
nintegerNumber of fractional bits.
Returns
TypeNameDescription
integerintegerThe integer number to read from.

#bytepack.writeFloatBE

sharedmenunodiscardsource
function bytepack.writeFloatBE(value: number): integer, integer, integer, integer

Writes signed 4-byte (32 bit) float as big endian bytes.

Parameters
NameTypeDescription
valuenumberThe signed 4-byte float.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.

#bytepack.writeFloatLE

sharedmenunodiscardsource
function bytepack.writeFloatLE(value: number): integer, integer, integer, integer

Writes signed 4-byte (32 bit) float as little endian bytes.

Parameters
NameTypeDescription
valuenumberThe signed 4-byte float.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.

#bytepack.writeHex16BE

sharedmenunodiscardsource
function bytepack.writeHex16BE(uint16: integer): integer, integer, integer, integer

Encodes unsigned 2-byte (16 bit) integer to big endian hex bytes.

Valid values without loss of precision: 0 - 65535

Parameters
NameTypeDescription
uint16integerThe unsigned 2-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.

#bytepack.writeHex16LE

sharedmenunodiscardsource
function bytepack.writeHex16LE(uint16: integer): integer, integer, integer, integer

Encodes unsigned 2-byte (16 bit) integer to little endian hex bytes.

Valid values without loss of precision: 0 - 65535

Parameters
NameTypeDescription
uint16integerThe unsigned 2-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.

#bytepack.writeHex24BE

sharedmenunodiscardsource
function bytepack.writeHex24BE(uint24: integer): integer, integer, integer, integer, integer, integer

Encodes unsigned 3-byte (24 bit) integer to big endian hex bytes.

Valid values without loss of precision: 0 - 16777215

Parameters
NameTypeDescription
uint24integerThe unsigned 3-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.

#bytepack.writeHex24LE

sharedmenunodiscardsource
function bytepack.writeHex24LE(uint24: integer): integer, integer, integer, integer, integer, integer

Encodes unsigned 3-byte (24 bit) integer to little endian hex bytes.

Valid values without loss of precision: 0 - 16777215

Parameters
NameTypeDescription
uint24integerThe unsigned 3-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.

#bytepack.writeHex32BE

sharedmenunodiscardsource
function bytepack.writeHex32BE(uint32: integer): integer, integer, integer, integer, integer, integer, integer, integer

Encodes unsigned 4-byte (32 bit) integer to big endian hex bytes.

Valid values without loss of precision: 0 - 4294967295

Parameters
NameTypeDescription
uint32integerThe unsigned 4-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.
integeruint8_7The seventh byte.
integeruint8_8The eighth byte.

#bytepack.writeHex32LE

sharedmenunodiscardsource
function bytepack.writeHex32LE(uint32: integer): integer, integer, integer, integer, integer, integer, integer, integer

Encodes unsigned 4-byte (32 bit) integer to little endian hex bytes.

Valid values without loss of precision: 0 - 4294967295

Parameters
NameTypeDescription
uint32integerThe unsigned 4-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.
integeruint8_7The seventh byte.
integeruint8_8The eighth byte.

#bytepack.writeHex8

sharedmenunodiscardsource
function bytepack.writeHex8(uint8: integer): integer, integer

Encodes unsigned 1-byte (8 bit) integer to big endian hex bytes.

Valid values without loss of precision: 0 - 255

Parameters
NameTypeDescription
uint8integerThe unsigned 1-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.

#bytepack.writeInt16BE

sharedmenunodiscardsource
function bytepack.writeInt16BE(value: integer): integer, integer

Writes signed 2-byte (16 bit) integer as big endian bytes.

Valid values without loss of precision: -32768 - 32767

Parameters
NameTypeDescription
valueintegerThe signed 2-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.

#bytepack.writeInt16LE

sharedmenunodiscardsource
function bytepack.writeInt16LE(value: integer): integer, integer

Writes signed 2-byte (16 bit) integer as little endian bytes.

Valid values without loss of precision: -32768 - 32767

Parameters
NameTypeDescription
valueintegerThe signed 2-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.

#bytepack.writeInt24BE

sharedmenunodiscardsource
function bytepack.writeInt24BE(value: integer): integer, integer, integer

Writes signed 3-byte (24 bit) integer as big endian bytes.

Valid values without loss of precision: -8388608 - 8388607

Parameters
NameTypeDescription
valueintegerThe signed 3-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.

#bytepack.writeInt24LE

sharedmenunodiscardsource
function bytepack.writeInt24LE(value: integer): integer, integer, integer

Writes signed 3-byte (24 bit) integer as little endian bytes.

Valid values without loss of precision: -8388608 - 8388607

Parameters
NameTypeDescription
valueintegerThe signed 3-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.

#bytepack.writeInt32BE

sharedmenunodiscardsource
function bytepack.writeInt32BE(value: integer): integer, integer, integer, integer

Writes signed 4-byte (32 bit) integer as big endian bytes.

Valid values without loss of precision: -2147483648 - 2147483647

Parameters
NameTypeDescription
valueintegerThe signed 4-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.

#bytepack.writeInt32LE

sharedmenunodiscardsource
function bytepack.writeInt32LE(value: integer): integer, integer, integer, integer

Writes signed 4-byte (32 bit) integer as little endian bytes.

Valid values without loss of precision: -2147483648 - 2147483647

Parameters
NameTypeDescription
valueintegerThe signed 4-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.

#bytepack.writeInt40BE

sharedmenunodiscardsource
function bytepack.writeInt40BE(value: integer): integer, integer, integer, integer, integer

Writes signed 5-byte (40 bit) integer as big endian bytes.

Valid values without loss of precision: -549755813888 - 549755813887

Parameters
NameTypeDescription
valueintegerThe signed 5-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.

#bytepack.writeInt40LE

sharedmenunodiscardsource
function bytepack.writeInt40LE(value: integer): integer, integer, integer, integer, integer

Writes signed 5-byte (40 bit) integer as little endian bytes.

Valid values without loss of precision: -549755813888 - 549755813887

Parameters
NameTypeDescription
valueintegerThe signed 5-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.

#bytepack.writeInt48BE

sharedmenunodiscardsource
function bytepack.writeInt48BE(value: integer): integer, integer, integer, integer, integer, integer

Writes signed 6-byte (48 bit) integer as big endian bytes.

Valid values without loss of precision: -140737488355328 - 140737488355327

Parameters
NameTypeDescription
valueintegerThe signed 6-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.

#bytepack.writeInt48LE

sharedmenunodiscardsource
function bytepack.writeInt48LE(value: integer): integer, integer, integer, integer, integer, integer

Writes signed 6-byte (48 bit) integer as little endian bytes.

Valid values without loss of precision: -140737488355328 - 140737488355327

Parameters
NameTypeDescription
valueintegerThe signed 6-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.

#bytepack.writeInt56BE

sharedmenunodiscardsource
function bytepack.writeInt56BE(value: integer): integer, integer, integer, integer, integer, integer, integer

Writes signed 7-byte (56 bit) integer as big endian bytes.

Valid values without loss of precision: -36028797018963968 - 36028797018963967

Parameters
NameTypeDescription
valueintegerThe signed 7-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.
integeruint8_7The seventh byte.

#bytepack.writeInt56LE

sharedmenunodiscardsource
function bytepack.writeInt56LE(value: integer): integer, integer, integer, integer, integer, integer, integer

Writes signed 7-byte (56 bit) integer as little endian bytes.

Valid values without loss of precision: -36028797018963968 - 36028797018963967

Parameters
NameTypeDescription
valueintegerThe signed 7-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.
integeruint8_7The seventh byte.

#bytepack.writeInt64BE

sharedmenunodiscardsource
function bytepack.writeInt64BE(value: integer): integer, integer, integer, integer, integer, integer, integer, integer

Writes signed 8-byte (64 bit) integer as big endian bytes.

Valid values without loss of precision: -9007199254740991 - 9007199254740991

All values above will have problems when working with them.

Parameters
NameTypeDescription
valueintegerThe signed 8-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.
integeruint8_7The seventh byte.
integeruint8_8The eighth byte.

#bytepack.writeInt64LE

sharedmenunodiscardsource
function bytepack.writeInt64LE(value: integer): integer, integer, integer, integer, integer, integer, integer, integer

Writes signed 8-byte (64 bit) integer as little endian bytes.

Valid values without loss of precision: -9007199254740991 - 9007199254740991

All values above will have problems when working with them.

Parameters
NameTypeDescription
valueintegerThe signed 8-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.
integeruint8_7The seventh byte.
integeruint8_8The eighth byte.

#bytepack.writeInt8

sharedmenunodiscardsource
function bytepack.writeInt8(value: integer): integer

Writes signed 1-byte (8 bit) integer as little endian bytes.

Valid values without loss of precision: -128 - 127

Parameters
NameTypeDescription
valueintegerThe signed 1-byte integer.
Returns
TypeNameDescription
integeruint8_1The byte.

#bytepack.writeTime

sharedmenunodiscardsource
function bytepack.writeTime(hours?: integer, minutes?: integer, seconds?: integer): integer

Writes time in DOS format as single Short number ( UInt16 ).

Values are clamped to the valid DOS ranges: hours 0 - 23, minutes 0 - 59, seconds 0 - 59.

Parameters
NameTypeDescription
hoursoptionalintegerThe number of hours.
minutesoptionalintegerThe number of minutes.
secondsoptionalintegerThe number of seconds, will be rounded.
Returns
TypeNameDescription
integeruint16The uint16 to read from.

#bytepack.writeUInt16BE

sharedmenunodiscardsource
function bytepack.writeUInt16BE(value: integer): integer, integer

Writes unsigned 2-byte (16 bit) integer as big endian bytes.

Valid values without loss of precision: 0 - 65535

Parameters
NameTypeDescription
valueintegerThe unsigned 2-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.

#bytepack.writeUInt16LE

sharedmenunodiscardsource
function bytepack.writeUInt16LE(value: integer): integer, integer

Writes unsigned 2-byte (16 bit) integer as little endian bytes.

Valid values without loss of precision: 0 - 65535

Parameters
NameTypeDescription
valueintegerThe unsigned 2-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.

#bytepack.writeUInt24BE

sharedmenunodiscardsource
function bytepack.writeUInt24BE(value: integer): integer, integer, integer

Writes unsigned 3-byte (24 bit) integer as big endian bytes.

Valid values without loss of precision: 0 - 16777215

Parameters
NameTypeDescription
valueintegerThe unsigned 3-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.

#bytepack.writeUInt24LE

sharedmenunodiscardsource
function bytepack.writeUInt24LE(value: integer): integer, integer, integer

Writes unsigned 3-byte (24 bit) integer as little endian bytes.

Valid values without loss of precision: 0 - 16777215

Parameters
NameTypeDescription
valueintegerThe unsigned 3-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.

#bytepack.writeUInt32BE

sharedmenunodiscardsource
function bytepack.writeUInt32BE(value: integer): integer, integer, integer, integer

Writes unsigned 4-byte (32 bit) integer as big endian bytes.

Valid values without loss of precision: 0 - 4294967295

Parameters
NameTypeDescription
valueintegerThe unsigned 4-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.

#bytepack.writeUInt32LE

sharedmenunodiscardsource
function bytepack.writeUInt32LE(value: integer): integer, integer, integer, integer

Writes unsigned 4-byte (32 bit) integer as little endian bytes.

Valid values without loss of precision: 0 - 4294967295

Parameters
NameTypeDescription
valueintegerThe unsigned 4-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.

#bytepack.writeUInt40BE

sharedmenunodiscardsource
function bytepack.writeUInt40BE(value: integer): integer, integer, integer, integer, integer

Writes unsigned 5-byte (40 bit) integer as big endian bytes.

Valid values without loss of precision: 0 - 1099511627775.

Parameters
NameTypeDescription
valueintegerThe unsigned 5-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.

#bytepack.writeUInt40LE

sharedmenunodiscardsource
function bytepack.writeUInt40LE(value: integer): integer, integer, integer, integer, integer

Writes unsigned 5-byte (40 bit) integer as little endian bytes.

Valid values without loss of precision: 0 - 1099511627775.

Parameters
NameTypeDescription
valueintegerThe unsigned 5-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.

#bytepack.writeUInt48BE

sharedmenunodiscardsource
function bytepack.writeUInt48BE(value: integer): integer, integer, integer, integer, integer, integer

Writes unsigned 6-byte (48 bit) integer as big endian bytes.

Valid values without loss of precision: 0 - 281474976710655

Parameters
NameTypeDescription
valueintegerThe unsigned 6-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.

#bytepack.writeUInt48LE

sharedmenunodiscardsource
function bytepack.writeUInt48LE(value: integer): integer, integer, integer, integer, integer, integer

Writes unsigned 6-byte (48 bit) integer as little endian bytes.

Valid values without loss of precision: 0 - 281474976710655

Parameters
NameTypeDescription
valueintegerThe unsigned 6-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.

#bytepack.writeUInt56BE

sharedmenunodiscardsource
function bytepack.writeUInt56BE(value: integer): integer, integer, integer, integer, integer, integer, integer

Writes unsigned 7-byte (56 bit) integer as big endian bytes.

Valid values without loss of precision: 0 - 9007199254740991

All values above will have problems when working with them.

Parameters
NameTypeDescription
valueintegerThe unsigned 7-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.
integeruint8_7The seventh byte.

#bytepack.writeUInt56LE

sharedmenunodiscardsource
function bytepack.writeUInt56LE(value: integer): integer, integer, integer, integer, integer, integer, integer

Writes unsigned 7-byte (56 bit) integer as little endian bytes.

Valid values without loss of precision: 0 - 9007199254740991

All values above will have problems when working with them.

Parameters
NameTypeDescription
valueintegerThe unsigned 7-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.
integeruint8_7The seventh byte.

#bytepack.writeUInt64BE

sharedmenunodiscardsource
function bytepack.writeUInt64BE(value: integer): integer, integer, integer, integer, integer, integer, integer, integer

Writes unsigned 8-byte (64 bit) integer as big endian bytes.

Valid values without loss of precision: 0 - 9007199254740991

All values above will have problems when working with them.

Parameters
NameTypeDescription
valueintegerThe unsigned 8-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.
integeruint8_7The seventh byte.
integeruint8_8The eighth byte.

#bytepack.writeUInt64LE

sharedmenunodiscardsource
function bytepack.writeUInt64LE(value: integer): integer, integer, integer, integer, integer, integer, integer, integer

Writes unsigned 8-byte (64 bit) integer as little endian bytes.

Valid values without loss of precision: 0 - 9007199254740991

All values above will have problems when working with them.

Parameters
NameTypeDescription
valueintegerThe unsigned 8-byte integer.
Returns
TypeNameDescription
integeruint8_1The first byte.
integeruint8_2The second byte.
integeruint8_3The third byte.
integeruint8_4The fourth byte.
integeruint8_5The fifth byte.
integeruint8_6The sixth byte.
integeruint8_7The seventh byte.
integeruint8_8The eighth byte.

#bytepack.writeUInt8

sharedmenunodiscardsource
function bytepack.writeUInt8(value: integer): integer

Writes unsigned 1-byte (8 bit) integer as bytes.

Valid values without loss of precision: 0 - 255

Parameters
NameTypeDescription
valueintegerThe unsigned 1-byte integer.
Returns
TypeNameDescription
integeruint8_1The byte.
Generated from the dreamwork meta branch.