aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-03-24 11:53:01 +0000
committerFuwn <[email protected]>2021-03-24 11:53:01 +0000
commit2bdb8bf9621f9626277de16cd778629baf70ab35 (patch)
treea13d239f73c62f2fb5af638bc98f05e3b5bc9030 /src/utils
parentformat: Update annotation (diff)
downloadwhirl-2bdb8bf9621f9626277de16cd778629baf70ab35.tar.xz
whirl-2bdb8bf9621f9626277de16cd778629baf70ab35.zip
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/byte.rs3
-rw-r--r--src/utils/mod.rs1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/byte.rs b/src/utils/byte.rs
new file mode 100644
index 0000000..01f10bb
--- /dev/null
+++ b/src/utils/byte.rs
@@ -0,0 +1,3 @@
+pub fn convert_u16_to_two_u8s_be(integer: u16) -> [u8; 2] {
+ [(integer >> 8) as u8, integer as u8]
+}
diff --git a/src/utils/mod.rs b/src/utils/mod.rs
index 1f54796..66f6db0 100644
--- a/src/utils/mod.rs
+++ b/src/utils/mod.rs
@@ -1,2 +1,3 @@
+pub mod byte;
pub mod db;
pub mod web;