Return an UUID based on the contents of a list, which should be a list of hashable elements.
(content)
| 511 | |
| 512 | |
| 513 | def get_uuid_on_content(content): |
| 514 | """ |
| 515 | Return an UUID based on the contents of a list, which should be |
| 516 | a list of hashable elements. |
| 517 | """ |
| 518 | identifier_string = repr(tuple(content)) |
| 519 | md_hash = sha1(identifier_string.encode('utf-8')) |
| 520 | return str(uuid.UUID(hex=md_hash.hexdigest()[:32])) |
| 521 | |
| 522 | |
| 523 | @attr.s |
no test coverage detected