summaryrefslogtreecommitdiff
path: root/xxd.ml
diff options
context:
space:
mode:
Diffstat (limited to 'xxd.ml')
-rw-r--r--xxd.ml6
1 files changed, 3 insertions, 3 deletions
diff --git a/xxd.ml b/xxd.ml
index 50e0072..bafc17d 100644
--- a/xxd.ml
+++ b/xxd.ml
@@ -55,7 +55,7 @@ let every n i = i > 0 && i mod n = 0
(* result length can be calculated in advance so we can do
this without realloc() *)
-let xxd_of_bytes ?(blocklen=0) src =
+let of_bytes ?(blocklen=0) src =
let ls = Bytes.length src in
if ls = 0 then "" else
let ld = 2 * ls + if blocklen = 0 then 0 else (ls - 1) / blocklen in
@@ -85,7 +85,7 @@ let int_of_nibble c =
if 'A' <= c && c <= 'F' then Some (int_of_char c - base_upper ) else
None
-let bytes_of_xxd src =
+let bytes_of src =
let ls = String.length src in
if ls = 0 then Bytes.empty else
let buf = Buffer.create bufsiz in
@@ -93,7 +93,7 @@ let bytes_of_xxd src =
if is = ls then
if hi = None then (Buffer.contents buf |> (!!)) else
raise (Invalid_argument
- "bytes_of_xxd: odd number of hex digits in input")
+ "Xxd.bytes_of: odd number of hex digits in input")
else
match String.get src is |> int_of_nibble with
| None -> aux hi (is+1)