# Generated by cpp4r: do not edit by hand

#' @title Hash Raw Bytes (C++)
#' @description Computes a fast, well-mixed 128-bit (32 hex character) hash of
#'   a raw vector, e.g. the output of \code{serialize()}. For hashing an R object
#'   directly, without serializing it first, see \code{hash()}.
#' @param x A raw vector, e.g. the output of \code{serialize()}.
#' @return A 32-character lowercase hex string.
#' @export
hash_raw <- function(x) {
	.Call(`_tinycache_hash_raw`, x)
}

#' @title Hash an R Object
#' @description Computes a fast, well-mixed 128-bit (32 hex character) hash of
#'   an R object, similar to \code{rlang::hash()}. Unlike hashing
#'   \code{serialize(x, connection = NULL)} (see \code{hash_raw()}), this walks the
#'   object's type, length, data bytes, and attributes directly, so it never
#'   allocates a serialized byte buffer. Supports atomic vectors (logical,
#'   integer, double, character, raw), lists, and their attributes meaning that it
#'   covers data frames, factors, and nested lists thereof. Other types (e.g.
#'   closures, environments, S4 objects) are not supported.
#' @param x An R object to hash.
#' @return A 32-character lowercase hex string.
#' @export
hash <- function(x) {
	.Call(`_tinycache_hash`, x)
}
