diff options
| author | Fuwn <[email protected]> | 2021-03-24 11:53:01 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-03-24 11:53:01 -0700 |
| commit | 36cc87e3dc5ddc082d5ad70e55e8bfe1e8a5a85d (patch) | |
| tree | 31fecab5a449f36d66aeae4fc3fb226d89c54278 /src/utils | |
| parent | format: Update annotation (diff) | |
| download | whirl-deprecated-legacy.tar.xz whirl-deprecated-legacy.zip | |
feature: Byte utilitiesdeprecated-maindeprecated-legacy
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/byte.rs | 3 | ||||
| -rw-r--r-- | src/utils/mod.rs | 1 |
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; |