From: Mark Wooding Date: Sat, 1 Jun 2024 03:25:30 +0000 (+0100) Subject: fshash.in: Introduce dummy conversions between binary and text strings. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/rsync-backup/commitdiff_plain/d2935500e2505010c687924539b8e9bf230ade2e?ds=inline fshash.in: Introduce dummy conversions between binary and text strings. --- diff --git a/fshash.in b/fshash.in index 1f1a34d..3d57292 100644 --- a/fshash.in +++ b/fshash.in @@ -41,6 +41,8 @@ VERSION = '@VERSION@' ###-------------------------------------------------------------------------- ### Utilities. +def bin(x): return x +def text(x): return x def excval(): return exc_info()[1] QUIS = OS.path.basename(argv[0]) @@ -302,7 +304,7 @@ class HashCache (object): fi.st = None fi.err = excval() return None - hash = B.hexlify(hash) + hash = text(B.hexlify(hash)) ## Insert a record into the database. if me._db: @@ -448,7 +450,7 @@ class Reporter (object): suffix = '' seq = 0 while True: - vino = '%08x' % (Z.crc32(fi.name + suffix) & 0xffffffff) + vino = '%08x' % (Z.crc32(bin(fi.name + suffix)) & 0xffffffff) if vino not in me._vinomap: break suffix = '\0%d' % seq seq += 1