aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-03-24 11:53:01 -0700
committerFuwn <[email protected]>2021-03-24 11:53:01 -0700
commit36cc87e3dc5ddc082d5ad70e55e8bfe1e8a5a85d (patch)
tree31fecab5a449f36d66aeae4fc3fb226d89c54278
parentformat: Update annotation (diff)
downloadwhirl-deprecated-main.tar.xz
whirl-deprecated-main.zip
feature: Byte utilitiesdeprecated-maindeprecated-legacy
-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;