shasum 的 --portable 选项有什么作用?

Fla*_*ino 6 shell checksum

shasum实用程序有一个-p/--portable选项,描述如下:

-p, --portable     read files in portable mode
                   produces same digest on Windows/Unix/Mac
Run Code Online (Sandbox Code Playgroud)

我从未见过包含此选项会更改文件的摘要,而且我也不确定它应该具有什么效果。这种读取文件的“便携模式”是什么?

Dav*_*ill 5

这种读取文件的“便携模式”是什么?

对于它的价值,沙苏姆说:

-p, --portable 以便携模式读取(已弃用

据我所知(我不是 Perl 专家),它似乎是为了考虑不同的 EOL 字符。

代码中说道:

The sums are computed as described in FIPS PUB 180-2.  When checking, the
input should be a former output of this program.  The default mode is to
print a line with checksum, a character indicating type (`*' for binary,
`?' for portable, ` ' for text), and name for each FILE.
Run Code Online (Sandbox Code Playgroud)

...

# Try to figure out if the OS is DOS-like.  If it is,
    # default to binary mode when reading files, unless
    # explicitly overriden by command line "--text" or
    # "--portable" options.
Run Code Online (Sandbox Code Playgroud)

...

我很高兴 Perl 专家能够查看完整的源代码并确认我的答案。