mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
support fips-cpython and maybe make-sfx on macos
This commit is contained in:
parent
ad18b6e15e
commit
f62dd0e3cc
|
@ -15,7 +15,7 @@ class Ico(object):
|
|||
def get(self, ext: str, as_thumb: bool) -> tuple[str, bytes]:
|
||||
"""placeholder to make thumbnails not break"""
|
||||
|
||||
zb = hashlib.md5(ext.encode("utf-8")).digest()[:2]
|
||||
zb = hashlib.sha1(ext.encode("utf-8")).digest()[2:4]
|
||||
if PY2:
|
||||
zb = [ord(x) for x in zb]
|
||||
|
||||
|
|
|
@ -14,10 +14,6 @@ gtar=$(command -v gtar || command -v gnutar) || true
|
|||
realpath() { grealpath "$@"; }
|
||||
}
|
||||
|
||||
which md5sum 2>/dev/null >/dev/null &&
|
||||
md5sum=md5sum ||
|
||||
md5sum="md5 -r"
|
||||
|
||||
mode="$1"
|
||||
|
||||
[ -z "$mode" ] &&
|
||||
|
|
|
@ -402,8 +402,8 @@ sed -r 's/(.*)\.(.*)/\2 \1/' | LC_ALL=C sort |
|
|||
sed -r 's/([^ ]*) (.*)/\2.\1/' | grep -vE '/list1?$' > list1
|
||||
|
||||
for n in {1..50}; do
|
||||
(grep -vE '\.(gz|br)$' list1; grep -E '\.(gz|br)$' list1 | shuf) >list || true
|
||||
s=$(md5sum list | cut -c-16)
|
||||
(grep -vE '\.(gz|br)$' list1; grep -E '\.(gz|br)$' list1 | (shuf||gshuf) ) >list || true
|
||||
s=$( (sha1sum||shasum) < list | cut -c-16)
|
||||
grep -q $s "$zdir/h" && continue
|
||||
echo $s >> "$zdir/h"
|
||||
break
|
||||
|
|
|
@ -213,11 +213,11 @@ def yieldfile(fn):
|
|||
|
||||
|
||||
def hashfile(fn):
|
||||
h = hashlib.md5()
|
||||
h = hashlib.sha1()
|
||||
for block in yieldfile(fn):
|
||||
h.update(block)
|
||||
|
||||
return h.hexdigest()
|
||||
return h.hexdigest()[:24]
|
||||
|
||||
|
||||
def unpack():
|
||||
|
|
Loading…
Reference in a new issue