mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-01 21:47:46 +00:00
hashsum: don't copy input buffer on Windows
Remove a copy operation of the input buffer being read for digest when reading in text mode on Windows. Previously, the code was copying the buffer to a completely new `Vec`, replacing "\r\n" with "\n". Instead, the code now scans for the indices at which each "\r\n" occurs in the input buffer and inputs into the digest only the characters before the "\r" and after it.
This commit is contained in:
parent
e5d6c6970b
commit
52cfd4c6cb
3 changed files with 20 additions and 24 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -2392,6 +2392,7 @@ dependencies = [
|
|||
"hex",
|
||||
"libc",
|
||||
"md5",
|
||||
"memchr 2.4.0",
|
||||
"regex",
|
||||
"regex-syntax",
|
||||
"sha1",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue