Skip to content

Returns the actor ID of the peer that created the change.

Usage

am_change_actor_id(change)

Arguments

change

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

Value

A raw vector containing the actor ID bytes

Examples

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

history <- am_get_changes(doc)
actor <- am_change_actor_id(history[[1]])
actor
#>  [1] b8 e8 48 f9 4e 2b 6c 0d b1 64 0e fc d8 00 f1 0c

# Should match the document's actor
identical(actor, am_get_actor(doc))  # TRUE
#> [1] TRUE

am_close(doc)