(data: bytes, encoding: int)
| 58 | |
| 59 | |
| 60 | def hash_meta_string_data(data: bytes, encoding: int) -> int: |
| 61 | length = len(data) |
| 62 | if length <= SMALL_STRING_THRESHOLD: |
| 63 | padded = data + b"\x00" * (16 - length) |
| 64 | v1 = int.from_bytes(padded[:8], "little", signed=False) |
| 65 | v2 = int.from_bytes(padded[8:16], "little", signed=False) |
| 66 | return hash_small_metastring(v1, v2, length, encoding) |
| 67 | hashcode = mmh3.hash_buffer(data, seed=47)[0] |
| 68 | return (hashcode >> 8 << 8) | (encoding & 0xFF) |
| 69 | |
| 70 | |
| 71 | class EncodedMetaString: |
no test coverage detected