mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
fix filekeys on windows
This commit is contained in:
parent
5aa893973c
commit
df6d4df4f8
|
@ -1974,7 +1974,7 @@ def rand_name(fdir: str, fn: str, rnd: int) -> str:
|
||||||
return fn
|
return fn
|
||||||
|
|
||||||
|
|
||||||
def gen_filekey(alg: int, salt: str, fspath: str, fsize: int, inode: int) -> str:
|
def _gen_filekey(alg: int, salt: str, fspath: str, fsize: int, inode: int) -> str:
|
||||||
if alg == 1:
|
if alg == 1:
|
||||||
zs = "%s %s %s %s" % (salt, fspath, fsize, inode)
|
zs = "%s %s %s %s" % (salt, fspath, fsize, inode)
|
||||||
else:
|
else:
|
||||||
|
@ -1984,6 +1984,13 @@ def gen_filekey(alg: int, salt: str, fspath: str, fsize: int, inode: int) -> str
|
||||||
return ub64enc(hashlib.sha512(zb).digest()).decode("ascii")
|
return ub64enc(hashlib.sha512(zb).digest()).decode("ascii")
|
||||||
|
|
||||||
|
|
||||||
|
def _gen_filekey_w(alg: int, salt: str, fspath: str, fsize: int, inode: int) -> str:
|
||||||
|
return _gen_filekey(alg, salt, fspath.replace("/", "\\"), fsize, inode)
|
||||||
|
|
||||||
|
|
||||||
|
gen_filekey = _gen_filekey_w if ANYWIN else _gen_filekey
|
||||||
|
|
||||||
|
|
||||||
def gen_filekey_dbg(
|
def gen_filekey_dbg(
|
||||||
alg: int,
|
alg: int,
|
||||||
salt: str,
|
salt: str,
|
||||||
|
|
Loading…
Reference in a new issue