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

fnushort readUint16(const(ubyte)[] data, ref size_t offset) @safe pure nothrow @nogcReads a big-endian uint16 from data[offset..offset+2].
fnuint readUint24(const(ubyte)[] data, ref size_t offset) @safe pure nothrow @nogcReads a big-endian uint24 from data[offset..offset+3].
fnuint readUint32(const(ubyte)[] data, ref size_t offset) @safe pure nothrow @nogcReads a big-endian uint32 from data[offset..offset+4].
fnubyte readUint8(const(ubyte)[] data, ref size_t offset) @safe pure nothrow @nogcReads a single byte from data[offset].
fnconst(ubyte)[] readVector8(const(ubyte)[] data, ref size_t offset) @safe pure nothrow @nogcReads a variable-length vector with uint8 length prefix.
fnconst(ubyte)[] readVector16(const(ubyte)[] data, ref size_t offset) @safe pure nothrow @nogcReads a variable-length vector with uint16 length prefix.
fnconst(ubyte)[] readVector24(const(ubyte)[] data, ref size_t offset) @safe pure nothrow @nogcReads a variable-length vector with uint24 length prefix.
fnubyte[2] writeUint16(ushort v) @safe pure nothrow @nogcWrites a big-endian uint16 to buf at position 0.
fnubyte[3] writeUint24(uint v) @safe pure nothrow @nogcWrites a big-endian uint24 to buf at position 0.
fnubyte[4] writeUint32(uint v) @safe pure nothrow @nogcWrites a big-endian uint32 to buf at position 0.
fnvoid appendUint8(ref ubyte[] buf, ubyte v) @safe pure nothrow
fnvoid appendUint16(ref ubyte[] buf, ushort v) @safe pure nothrowAppends a uint16 big-endian to an output array.
fnvoid appendUint24(ref ubyte[] buf, uint v) @safe pure nothrowAppends a uint24 big-endian to an output array.
fnvoid appendUint32(ref ubyte[] buf, uint v) @safe pure nothrowAppends a uint32 big-endian to an output array.
fnvoid appendUint64(ref ubyte[] buf, ulong v) @safe pure nothrow