ddn.net.tls.buffer
TLS byte buffer utilities.
Provides functions for reading and writing TLS wire-format values (big-endian integers, variable-length vectors, etc.) per RFC 5246 §4.4 and RFC 8446 §3.
Functions 15
fn
ushort readUint16(const(ubyte)[] data, ref size_t offset) @safe pure nothrow @nogcReads a big-endian uint16 from data[offset..offset+2].fn
uint readUint24(const(ubyte)[] data, ref size_t offset) @safe pure nothrow @nogcReads a big-endian uint24 from data[offset..offset+3].fn
uint readUint32(const(ubyte)[] data, ref size_t offset) @safe pure nothrow @nogcReads a big-endian uint32 from data[offset..offset+4].fn
ubyte readUint8(const(ubyte)[] data, ref size_t offset) @safe pure nothrow @nogcReads a single byte from data[offset].fn
const(ubyte)[] readVector8(const(ubyte)[] data, ref size_t offset) @safe pure nothrow @nogcReads a variable-length vector with uint8 length prefix.fn
const(ubyte)[] readVector16(const(ubyte)[] data, ref size_t offset) @safe pure nothrow @nogcReads a variable-length vector with uint16 length prefix.fn
const(ubyte)[] readVector24(const(ubyte)[] data, ref size_t offset) @safe pure nothrow @nogcReads a variable-length vector with uint24 length prefix.fn
ubyte[2] writeUint16(ushort v) @safe pure nothrow @nogcWrites a big-endian uint16 to buf at position 0.fn
ubyte[3] writeUint24(uint v) @safe pure nothrow @nogcWrites a big-endian uint24 to buf at position 0.fn
ubyte[4] writeUint32(uint v) @safe pure nothrow @nogcWrites a big-endian uint32 to buf at position 0.fn
void appendUint16(ref ubyte[] buf, ushort v) @safe pure nothrowAppends a uint16 big-endian to an output array.fn
void appendUint24(ref ubyte[] buf, uint v) @safe pure nothrowAppends a uint24 big-endian to an output array.fn
void appendUint32(ref ubyte[] buf, uint v) @safe pure nothrowAppends a uint32 big-endian to an output array.