Get serialized and utf-8 encoded record data with padding
(data)
| 130 | |
| 131 | |
| 132 | def get_record_data_json_bytes(data): # type: (dict) -> bytes |
| 133 | """Get serialized and utf-8 encoded record data with padding""" |
| 134 | data_str = json.dumps(data) |
| 135 | padding = int(math.ceil(max(384, len(data_str)) / 16) * 16) |
| 136 | if padding: |
| 137 | data_str = data_str.ljust(padding) |
| 138 | return data_str.encode('utf-8') |
| 139 | |
| 140 | |
| 141 | def pad_aes_gcm(json): |