Skip to content

Commit 5974faf

Browse files
newAMeldruin
authored andcommitted
Remove byteorder dependency
1 parent 682b074 commit 5974faf

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
### Removed
11+
12+
- Removed the `byteorder` dependency.
13+
1014
## [v0.3.1] - 2022-08-09
1115

1216
### Fixed

Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,3 @@ license = "MIT OR Apache-2.0"
77
name = "hash32"
88
repository = "https://github.com/rust-embedded-community/hash32"
99
version = "0.3.1"
10-
11-
[dependencies.byteorder]
12-
default-features = false
13-
version = "1.2.2"

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@
5050
#![deny(warnings)]
5151
#![no_std]
5252

53-
extern crate byteorder;
54-
5553
use core::fmt;
5654
use core::hash::BuildHasher;
5755
use core::marker::PhantomData;

src/murmur3.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
use core::slice;
21
use core::mem::MaybeUninit;
3-
4-
use byteorder::{ByteOrder, LE};
2+
use core::slice;
53

64
use crate::Hasher as _;
75

@@ -192,7 +190,7 @@ const R1: u32 = 15;
192190

193191
impl State {
194192
fn process_block(&mut self, block: &MaybeUninit<[u8; 4]>) {
195-
self.0 ^= pre_mix(LE::read_u32(unsafe { block.assume_init_ref() }));
193+
self.0 ^= pre_mix(u32::from_le_bytes(unsafe { *block.assume_init_ref() }));
196194
self.0 = self.0.rotate_left(13);
197195
self.0 = 5u32.wrapping_mul(self.0).wrapping_add(0xe6546b64);
198196
}

0 commit comments

Comments
 (0)