raw_deparse_str: Serialize a raw vector to a string

View source: R/raw.R

raw_deparse_strR Documentation

Serialize a raw vector to a string

Description

[Experimental]

This function converts a raw vector to a hexadecimal string, optionally adding a prefix and a suffix. It is roughly equivalent to paste0(prefix, paste(format(x), collapse = ""), suffix) and much faster.

Usage

raw_deparse_str(x, prefix = NULL, suffix = NULL)

Arguments

x

A raw vector.

prefix, suffix

Prefix and suffix strings, or 'NULL.

Value

A string.

Examples

raw_deparse_str(raw())
raw_deparse_str(charToRaw("string"))
raw_deparse_str(raw(10), prefix = "'0x", suffix = "'")

hadley/rlang documentation built on Dec. 17, 2024, 3:26 a.m.