[issue42942] Feature request: Add decdigest() to hashlib

2021-01-17 Thread Arnim Rupp
Arnim Rupp added the comment: oh, you're absolutely right about digest(), sorry, mixed the representation with the data. closing this, thanks. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracke

[issue42942] Feature request: Add decdigest() to hashlib

2021-01-16 Thread Arnim Rupp
New submission from Arnim Rupp : Problem: hashlib only offers digest() and hexdigest() but the fastest way to work with hashes is as integer. The first thing loki does after getting the hashes is to convert them to int: md5, sha1, sha256 = generateHashes(fileData

[issue42885] Optimize re.search() for \A (and maybe ^)

2021-01-16 Thread Arnim Rupp
Change by Arnim Rupp : -- components: +Regular Expressions -Library (Lib) nosy: +ezio.melotti, mrabarnett ___ Python tracker <https://bugs.python.org/issue42

[issue42885] Optimize re.search() for \A (and maybe ^)

2021-01-16 Thread Arnim Rupp
Arnim Rupp added the comment: some more observations, which might be helpful in tracking it down: x$ is much faster than ^x A$ is as slow as ^x $ python3 -m timeit -s "a = 'A'*1" "import re" "re.search('x$', a)" 10 loops, best of 5: 32.9 msec pe

[issue42885] Regex performance problem with ^ aka AT_BEGINNING

2021-01-10 Thread Arnim Rupp
New submission from Arnim Rupp : The re lib needs 7 seconds to check if a billion As start with an x. So e.g. this statement takes this long: re.search(r'^x', 'A' * 10) It takes longer, the longer the string is. The string handling is not the problem, checking if it starts which