MySQL 8.0.29
Source Code Documentation
my_hex_tools.h
Go to the documentation of this file.
1/* Copyright (c) 2021, 2022, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef COMPONENT_HEX_TOOLS_H_
24#define COMPONENT_HEX_TOOLS_H_
25
26/**
27 Convert byte array to hex string
28
29 @param [out] to Output buffer
30 @param [in] from Input byte array
31 @param [in] length Length of input
32
33 @returns Length of output string
34*/
35extern "C" unsigned long hex_string(char *to, const char *from,
36 unsigned long length);
37
38/**
39 Convert hex string to byte array.
40
41 @param [in] first Pointer to first element of range to convert
42 @param [in] last Pointer to one-after-last element of range to convert
43 @param [out] output Beginning of destination range.
44
45 @returns Length of output string
46*/
47extern "C" unsigned long unhex_string(const char *first, const char *last,
48 char *output);
49
50#endif // COMPONENT_HEX_TOOLS_H_
unsigned long hex_string(char *to, const char *from, unsigned long length)
Convert byte array to hex string.
Definition: my_hex_tools.cc:111
unsigned long unhex_string(const char *first, const char *last, char *output)
Convert hex string to byte array.
Definition: my_hex_tools.cc:91
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75