base58enc: Base58 Encode

View source: R/base.R

base58encR Documentation

Base58 Encode

Description

Encodes a character string, raw vector or other object to base58 encoding with a 4-byte checksum suffix.

Usage

base58enc(x, convert = TRUE)

Arguments

x

an object.

convert

logical TRUE to encode to a character string or FALSE to a raw vector.

Details

Adds a 4-byte checksum suffix (double SHA-256) to the data before base58 encoding. Note: does not include a version byte prefix (unlike Bitcoin Base58Check).

A character string or raw vector (with no attributes) is encoded as is, whilst all other objects are first serialized (using R serialisation version 3, big-endian representation).

Value

A character string or raw vector depending on the value of convert.

References

This implementation is based on 'libbase58' by Luke Dashjr under the MIT licence at https://github.com/luke-jr/libbase58.

See Also

base58dec()

Examples

base58enc("secret base")
base58enc(as.raw(c(1L, 2L, 4L)), convert = FALSE)
base58enc(data.frame())


secretbase documentation built on Feb. 5, 2026, 9:09 a.m.