mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
Introduce a =: operator
This commit is contained in:
1 parent
0a61b0cc44
commit
79aded4797
6 files changed
+12
-10
No files matched your search
@@ -34,7 +34,7 @@ pub func hasher.update(x slice base.u8)(checksum base.u32) {
|
||||
in.x = in.x[:5552]
|
||||
}
|
||||
|
||||
iterate (length:1, unroll:8)(p slice base.u8:in.x) {
|
||||
iterate (length:1, unroll:8)(p slice base.u8 =: in.x) {
|
||||
s1 ~mod+= p[0] as base.u32
|
||||
s2 ~mod+= s1
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ pub struct ieee_hasher?(
|
||||
pub func ieee_hasher.update(x slice base.u8)(checksum base.u32) {
|
||||
var s base.u32 = 0xFFFFFFFF ^ this.state
|
||||
|
||||
iterate (length:8, unroll:8)(p slice base.u8:in.x) {
|
||||
iterate (length:8, unroll:8)(p slice base.u8 =: in.x) {
|
||||
// TODO: explain the slicing-by-8 algorithm.
|
||||
s ^= ((p[0] as base.u32) << 0) |
|
||||
((p[1] as base.u32) << 8) |
|
||||
|
||||
Reference in new issue
Block a user