Skip to content

Returns the unique hash identifier of a change. Change hashes are used to reference specific points in document history (e.g., with am_get_change_by_hash() or am_fork()).

Usage

am_change_hash(change)

Arguments

change

An am_change object (from am_get_changes() or am_change_from_bytes())

Value

A raw vector (32 bytes) containing the change hash

Examples

doc <- am_create()
am_put(doc, AM_ROOT, "key", "value")
am_commit(doc, "Add key")

history <- am_get_changes(doc)
hash <- am_change_hash(history[[1]])
hash
#>  [1] 75 51 98 64 d2 56 b3 64 bb 4c b9 6e 8b 45 e8 b9 42 46 c7 56 ef d1
#> [23] 48 01 9b 98 0d 77 a9 7a a7 5d

am_close(doc)