comparison cutils/util/__init__.py @ 185:f04d4b1c14b3

FIX: "digest" had overwritteh the digest module
author Franz Glasner <fzglas.hg@dom66.de>
date Tue, 14 Jan 2025 11:35:18 +0100
parents 6154b8e4ba94
children 2784fdcc99e5
comparison
equal deleted inserted replaced
184:6154b8e4ba94 185:f04d4b1c14b3
161 return (get_crc("crc-64-xz"), "CRC-64-XZ") 161 return (get_crc("crc-64-xz"), "CRC-64-XZ")
162 elif s in ("crc64-go", "crc-64-go", 162 elif s in ("crc64-go", "crc-64-go",
163 "crc64-go-iso", "crc-64-go-iso"): 163 "crc64-go-iso", "crc-64-go-iso"):
164 return (get_crc("crc-64-go"), "CRC-64-GO-ISO") 164 return (get_crc("crc-64-go"), "CRC-64-GO-ISO")
165 elif s in ("crc64-redis", "crc-64-redis"): 165 elif s in ("crc64-redis", "crc-64-redis"):
166 return (get_crc("crc-64-redis"), "CRC-64-REDIS") 166 return (get_crc("crc-64-redis"), "CRC-64-REDIS")
167 else: 167 else:
168 raise argparse.ArgumentTypeError( 168 raise argparse.ArgumentTypeError(
169 "`{}' is not a recognized algorithm".format(s)) 169 "`{}' is not a recognized algorithm".format(s))
170 170
171 171
221 elif s == "CRC-64-XZ": 221 elif s == "CRC-64-XZ":
222 return get_crc("crc-64-xz") 222 return get_crc("crc-64-xz")
223 elif s == "CRC-64-GO-ISO": 223 elif s == "CRC-64-GO-ISO":
224 return get_crc("crc-64-go") 224 return get_crc("crc-64-go")
225 elif s == "CRC-64-REDIS": 225 elif s == "CRC-64-REDIS":
226 return get_crc("crc-64-redis") 226 return get_crc("crc-64-redis")
227 else: 227 else:
228 raise ValueError("unknown algorithm: {}".format(s)) 228 raise ValueError("unknown algorithm: {}".format(s))
229 229
230 230
231 def normalize_filename(filename, strip_leading_dot_slash=False): 231 def normalize_filename(filename, strip_leading_dot_slash=False):