3 ms·
The code is so weird, people will have a hard time reading it when they need to check for correctness. There are much better ways to write it in Rust: https://
by f311a 3mo ago
The code is so weird, people will have a hard time reading it when they need to check for correctness.
There are much better ways to write it in Rust: https://github.com/malisper/pgrust/blob/14ffab7d31a31e5ab667f7a051f693fad9c031ac/crates/common/md5/src/lib.rs#L190 https://github.com/malisper/pgrust/blob/14ffab7d31a31e5ab667...
- wavemode 3mo agoI mean, you've linked to a function performing md5 hashing. That's pretty much exactly what I would expect such code to look like. Case in point: https://github.com/postgres/postgres/blob/master/src/common/md5.c#L235 https://github.com/postgres/postgres/blob/master/src/common/...
- f311a 3mo agoIt's not idiomatic implementation in Rust, just translation from C. A few Rust macros simplify implementation and cut the code in half.