drop util functions
-#![allow(dead_code)]
// maelstrom
// Copyright (C) 2020 Raphael Robert
//
@@ -35,28 +34,6 @@ pub fn random_u32() -> u32 {
OsRng.next_u32()
}
-pub(crate) fn u32_to_bytes(d: &[u32]) -> Vec<u8> {
- let mut out = Vec::<u8>::new();
- for e in d.iter() {
- out.push((e & 0xFF) as u8);
- out.push(((e & 0xFF00) >> 8) as u8);
- out.push(((e & 0xFF0000) >> 16) as u8);
- out.push(((e & 0xFF000000) >> 24) as u8);
- }
- out
-}
-
-pub(crate) fn bytes_to_u32(bytes: &[u8]) -> Vec<u32> {
- debug_assert!(bytes.len() % 4 == 0);
- let mut out = Vec::<u32>::new();
- for i in (0..bytes.len()).step_by(4) {
- out.push((bytes[i+3] as u32) << 24 | (bytes[i+2] as u32) << 16 |
- (bytes[i+1] as u32) << 8 | bytes[i] as u32);
- }
- debug_assert!(out.len() == bytes.len() / 4);
- out
-}
-
pub fn bytes_to_hex(bytes: &[u8]) -> String {
let mut hex = String::new();
for b in bytes {
