diff --git a/src/MySqlCdc/Events/RandEvent.cs b/src/MySqlCdc/Events/RandEvent.cs
new file mode 100644
index 0000000..cbdc9e3
--- /dev/null
+++ b/src/MySqlCdc/Events/RandEvent.cs
@@ -0,0 +1,21 @@
+namespace MySqlCdc.Events;
+
+ ///
+ /// Represents two seed values that set the rand_seed1 and rand_seed2 system variables that are used to compute the random number.
+ /// See more
+ ///
+ ///
+ /// Creates a new .
+ ///
+ public record RandEvent(ulong Seed1, ulong Seed2) : IBinlogEvent
+ {
+ ///
+ /// Gets the rand_seed1
+ ///
+ public ulong Seed1 {get; } = Seed1;
+
+ ///
+ /// Gets the rand_seed2
+ ///
+ public ulong Seed2 { get; } = Seed2;
+ }
\ No newline at end of file
diff --git a/src/MySqlCdc/Parsers/RandEventParser.cs b/src/MySqlCdc/Parsers/RandEventParser.cs
new file mode 100644
index 0000000..2d7a5c5
--- /dev/null
+++ b/src/MySqlCdc/Parsers/RandEventParser.cs
@@ -0,0 +1,23 @@
+using MySqlCdc.Events;
+using MySqlCdc.Protocol;
+
+namespace MySqlCdc.Parsers;
+
+ ///
+ /// Parses events.
+ /// Supports all versions of MariaDB and MySQL.
+ ///
+
+ public class RandEventParser : IEventParser
+ {
+ ///
+ /// Parses from the buffer.
+ ///
+ public IBinlogEvent ParseEvent(EventHeader header, ref PacketReader reader)
+ {
+ var seed1 = reader.ReadUInt64LittleEndian();
+ var seed2 = reader.ReadUInt64LittleEndian();
+
+ return new RandEvent(seed1, seed2);
+ }
+ }
diff --git a/src/MySqlCdc/Protocol/PacketReader.cs b/src/MySqlCdc/Protocol/PacketReader.cs
index 4f9e0d3..892b434 100644
--- a/src/MySqlCdc/Protocol/PacketReader.cs
+++ b/src/MySqlCdc/Protocol/PacketReader.cs
@@ -66,6 +66,16 @@ public UInt32 ReadUInt32BigEndian()
return result;
}
+ ///
+ /// Reads 64-bit long written in little-endian format.
+ ///
+ public UInt64 ReadUInt64LittleEndian()
+ {
+ UInt64 result = BinaryPrimitives.ReadUInt64LittleEndian(_span.Slice(_offset));
+ _offset += 8;
+ return result;
+ }
+
///
/// Reads 64-bit long written in little-endian format.
///
diff --git a/tests/MySqlCdc.Tests/Parsers/RandEventParserTests.cs b/tests/MySqlCdc.Tests/Parsers/RandEventParserTests.cs
new file mode 100644
index 0000000..6f66d24
--- /dev/null
+++ b/tests/MySqlCdc.Tests/Parsers/RandEventParserTests.cs
@@ -0,0 +1,29 @@
+
+using MySqlCdc.Events;
+using MySqlCdc.Parsers;
+using MySqlCdc.Protocol;
+using Xunit;
+
+namespace MySqlCdc.Tests.Parsers;
+
+public class RandEventParserTests
+{
+ private static byte[] Payload = {
+ 0x5f, 0x56, 0x75, 0x65, 0x0d, 0x01, 0x00, 0x00, 0x00, 0x27, 0x00,
+ 0x00, 0x00, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xdb, 0x85, 0x2d, 0x00, 0x00,
+ 0x00, 0x00, 0x07, 0x97, 0xbc, 0x04, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x6e, 0x46, 0xdd
+ };
+
+ [Fact]
+ public void Test_RandEvent_ReturnsEvent()
+ {
+ var reader = new PacketReader(Payload);
+ var eventHeader = EventHeader.Read(ref reader);
+
+ var parser = new RandEventParser();
+ var @event = (RandEvent)parser.ParseEvent(eventHeader, ref reader);
+ ;
+ Assert.Equal(763747084UL, @event.Seed1);
+ Assert.Equal(79468295UL, @event.Seed2);
+ }
+}
\ No newline at end of file