create_timestamp: Create a timestamp for a for an R object or file.

View source: R/create_timestamp.R

create_timestampR Documentation

Create a timestamp for a for an R object or file.

Description

Submit a hash of x to obtain a Trusted Time Stamp for that hash wrapper around https://doc.originstamp.org/#!/default/post_hash_string

Usage

create_timestamp(
  x,
  error_on_fail = TRUE,
  comment = "test",
  notifications = data.frame(currency = 0, notification_type = 0, target =
    "originstamp@trashmail.com"),
  url = api_url(),
  key = api_key()
)

Arguments

x

an R object (character vector containing file names of existing files or strings) of which a hash will be calculated using the function hash(x). The resulting hash will be submitted to OriginStamp.

error_on_fail

if TRUE, raise error when api call fails, otherwise return the failed response.

comment

a comment for the new timestamp

notifications

notification settings

url

the url of the api. The default is to use the url as returned by the function api_url()

key

the api key. The default is to use the key as returned by the function api_key()

Details

The behavior depends on the class of the argument x:

  • an object of class hash as returned by the package openssl: the hash is submitted to OriginStamp

  • character vector of length 1 containing the name of an existing file: the hash of the file is calculated and submitted to OriginStamp

  • any other R object: the hash is calculated using the function hash() and submitted to OriginStamp

Value

object of type OriginStampResponse

Examples


## Not run: 
# create timestamp
create_timestamp(
  x = letters
)

## End(Not run)

rkrug/ROriginStamp documentation built on Aug. 16, 2022, 5:45 p.m.