BareGit
#pragma once

#include <string>
#include <string_view>

#include <mw/error.hpp>

#include "card.h"

/// Format the canonical lowercase public ID derived from a card identity.
mw::E<std::string> formatPublicId(const CardIdentity& identity);

/// Parse a canonical lowercase public ID into its persisted identity.
mw::E<CardIdentity> parsePublicId(std::string_view public_id);

/// Compare canonical public IDs using numeric runs as integers.
bool naturalPublicIdLess(std::string_view left, std::string_view right);