ComputeVersionedHash follows the same rules of ComputeHash with the exception that accepts also a epoc value. The epoc value is used to generate a new hash from a same object. This is useful to force a new hash even if the original object is not changed. A practical use is to force a reconciliation
(object interface{}, epoc int)
| 60 | // This is useful to force a new hash even if the original object is not changed. |
| 61 | // A practical use is to force a reconciliation loop of the object. |
| 62 | func ComputeVersionedHash(object interface{}, epoc int) (string, error) { |
| 63 | type versionedHash struct { |
| 64 | object interface{} |
| 65 | epoc int |
| 66 | } |
| 67 | |
| 68 | return ComputeHash(versionedHash{object: object, epoc: epoc}) |
| 69 | } |
no test coverage detected