aboutsummaryrefslogtreecommitdiff
path: root/ivy.ml
diff options
context:
space:
mode:
authorgautier.hattenberger2020-03-22 11:23:12 +0000
committergautier.hattenberger2020-03-22 11:23:12 +0000
commit9cb0e7768b7e0281a38686088cedeaee4d74790a (patch)
treec68fbc33ba603b7a7af13706d6e145a535f2c8db /ivy.ml
parent1e696cd276931081d0bfec92f45a9ac023facd98 (diff)
downloadivy-ocaml-master.zip
ivy-ocaml-master.tar.gz
ivy-ocaml-master.tar.bz2
ivy-ocaml-master.tar.xz
update to 1.3.2HEADmaster
fix depreciated String issue
Diffstat (limited to 'ivy.ml')
-rw-r--r--ivy.ml14
1 files changed, 7 insertions, 7 deletions
diff --git a/ivy.ml b/ivy.ml
index f031252..d12ae6f 100644
--- a/ivy.ml
+++ b/ivy.ml
@@ -55,21 +55,21 @@ let hexa_code = fun c ->
let hexa_of_string = fun s ->
let n = String.length s in
- let h = String.create (n*2) in
+ let h = Bytes.create (n*2) in
for i = 0 to n - 1 do
let c = Char.code s.[i] in
- h.[2*i] <- hexa_char (c lsr 4);
- h.[2*i+1] <- hexa_char (c land 0xf)
+ Bytes.set h (2*i) (hexa_char (c lsr 4));
+ Bytes.set h (2*i+1) (hexa_char (c land 0xf))
done;
- h
+ Bytes.to_string h
let string_of_hexa = fun h ->
let n = String.length h / 2 in
- let s = String.create n in
+ let s = Bytes.create n in
for i = 0 to n - 1 do
- s.[i] <- Char.chr (hexa_code h.[2*i] lsl 4 + hexa_code h.[2*i+1])
+ Bytes.set s i (Char.chr (hexa_code h.[2*i] lsl 4 + hexa_code h.[2*i+1]))
done;
- s
+ Bytes.to_string s
let send_data = fun tag value ->