Skip to contents

The SHA-256 of the RFC 8785 canonical JSON of the type's name, its declaration hash, and the value, written sha256:<hex>. Values that differ only in member order or in defaults written out hash the same. A matrix, an array, a sparse matrix, a table, and a vec() of logical, integer, double, date, or date-time values enter through the digest of their canonical binary form. A host-only field's value stays out of the hash; its presence enters it. The hash is computed from the R objects in place.

Usage

r8hash(x)

Arguments

x

An R8 value.

Value

Character: The hash.

Examples

op <- options(r8.namespace = "demo")
Point <- new_struct("Point", fields = list(x = type_double(), y = type_double()))
r8hash(Point(x = 1, y = 2))
#> [1] "sha256:1a15c3bcb6e6fe623b78b02ddf352f3b43e34e4c414874eb594e600094f1af24"
options(op)