summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <kent@mysql.com>2005-08-23 18:06:24 +0200
committerunknown <kent@mysql.com>2005-08-23 18:06:24 +0200
commitd93563f288161103fc41ad00f816576a2b310393 (patch)
tree46452e598fd6c0fd4dbc3a3b02e8459deb474070 /mysys
parenta797112c8ae81cb721a58d2d54067e1b54884a3f (diff)
parent13c347e7e76f15fb0dc6770355cf44d3af4f3c54 (diff)
downloadmariadb-git-d93563f288161103fc41ad00f816576a2b310393.tar.gz
Merge
Diffstat (limited to 'mysys')
-rw-r--r--mysys/charset.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysys/charset.c b/mysys/charset.c
index 3a39fce9437..d57719673b9 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -663,3 +663,22 @@ CHARSET_INFO *fs_character_set()
return fs_cset_cache;
}
#endif
+
+/*
+ Transforms a string into hex form.
+ */
+char *bare_str_to_hex(char *to, const char *from, uint len)
+{
+ char *p= to;
+ uint i;
+ for (i= 0; i < len; i++, p+= 2)
+ {
+ /* val[i] is char. Casting to uchar helps greatly if val[i] < 0 */
+ uint tmp= (uint) (uchar) from[i];
+ p[0]= _dig_vec_upper[tmp >> 4];
+ p[1]= _dig_vec_upper[tmp & 15];
+ }
+ *p= 0;
+ return p; /* pointer to end 0 of 'to' */
+}
+