package mysql_protocol

  1. Overview
  2. Docs
OCaml implementation of the native MySQL/MariaDB Protocol with the Bitstring library

Install

Dune Dependency

Authors

Maintainers

Sources

3.0.3.tar.gz
md5=25881ffc4a6c0e974703d014b6b38a42
sha512=60ee821bfeaaf7996d803f560d87f171e5205cd41494cc5579d8e794755b1f1747e7c7da9d83b6e4c73ebe41d680a2306db2d26b72467c7d8789573da37f246c

doc/src/mysql_protocol/mp_auth_switch_request.ml.html

Source file mp_auth_switch_request.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

type auth_switch_request_packet = {
  plugin_name : string;
  plugin_data : Bitstring.t
}

let auth_switch_request_packet_to_string p =
  Printf.sprintf "plugin_name : %s\nplugin_data : %s\n"
    p.plugin_name (Bitstring.string_of_bitstring p.plugin_data)

let auth_switch_request_packet_bits_without_0xFE_prefix bits =
  let length = Bitstring.bitstring_length bits in
  match%bitstring bits with
  | {|  "mysql_native_password" : 21*8 : string;
        0x00 : 8 : int;
        plugin_data : length - ((21+1+1)*8) : bitstring;
        0x00 : 8 : int |} ->
    { plugin_name = "mysql_native_password"; plugin_data }
OCaml

Innovation. Community. Security.