ratiopath.tiling.utils
row_hash(row, column='id', algorithm=hashlib.sha256)
Hashes a row (dictionary) using SHA256 and adds the hash as a new column.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
row
|
dict[str, Any]
|
The dictionary (row) to hash. |
required |
column
|
str
|
The name of the column to store the hash. Defaults to "id". |
'id'
|
algorithm
|
Callable[[bytes], HASH]
|
The hashing algorithm to use. Defaults to hashlib.sha256. |
sha256
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
The modified row (dictionary) with the SHA256 hash added. |
Source code in ratiopath/tiling/utils.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|