base32_decode: Decode base-32 representation of deck code

View source: R/base32_handling.R

base32_decodeR Documentation

Decode base-32 representation of deck code

Description

Deck lists are stored and shared in an RFC 4648 base-32 code. This function decodes this first into varint bytes to get to the integer representation of the deck list. The output can be further parsed according to these rules.

Usage

base32_decode(code, max_known_version = 4)

Arguments

code

character deck code in base 32 (RFC 4648)

max_known_version

integer of version of encoding. Only effect is which regions are available due to expansions.

Value

integer vector describing the deck list (without the version info in the first byte, which is only used for a validity check)

Examples

lordecks:::base32_decode(
 "CEDACAIFDUAQEBAIAECAIBICAECDGNACAMCQIBQDAMCAKDISAIAQCBBWAIAQKEZPAIAQGBIMAMAQKAIZEE"
 )
# returns
# c( 6, 1, 1, 5, 29, 1, 2, 4, 8, 1, 4,
#    4, 5, 2, 1, 4, 51, 52, 2, 3, 5, 4, 6, 3, 3, 4, 5,
#    13, 18, 2, 1, 1, 4, 54, 2, 1, 5, 19, 47, 2, 1, 3,
#    5, 12, 3, 1, 5, 1, 25, 33)

pholzmgit/lordecks documentation built on May 23, 2022, 11:03 a.m.