(value, sha=False)
| 49 | |
| 50 | |
| 51 | def _process(value, sha=False): |
| 52 | if isinstance(value, (six.text_type, bytes)): |
| 53 | if sha: |
| 54 | return hashlib.sha1(to_bytes(value)).hexdigest() |
| 55 | return 'h', hash(value) |
| 56 | if isinstance(value, dict): |
| 57 | return {_process(k, sha=True): _process(v, sha) for k, v in value.items()} |
| 58 | if isinstance(value, (list, tuple)): |
| 59 | return [_process(v, sha) for v in value] |
| 60 | return value |
| 61 | |
| 62 | |
| 63 | def _fast_hash(value): |
no outgoing calls
no test coverage detected