Learn R Programming

automerge (version 0.4.0)

am_change_hash: Get the hash of a change

Description

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)

Value

A raw vector (32 bytes) containing the change hash

Arguments

change

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

Examples

Run this code
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

am_close(doc)

Run the code above in your browser using DataLab