Inside Bitcoin
Opening the selected file…
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1// Copyright (c) 2009-present The Bitcoin Core developers2// Distributed under the MIT software license, see the accompanying3// file COPYING or http://www.opensource.org/licenses/mit-license.php.5#ifndef BITCOIN_CRYPTO_HEX_BASE_H6#define BITCOIN_CRYPTO_HEX_BASE_H8#include <span.h>10#include <cstddef>11#include <cstdint>12#include <span>13#include <string>15/**16* Convert a span of bytes to a lower-case hexadecimal string.17*/18std::string HexStr(std::span<const uint8_t> s);19inline std::string HexStr(std::span<const char> s) { return HexStr(MakeUCharSpan(s)); }20inline std::string HexStr(std::span<const std::byte> s) { return HexStr(MakeUCharSpan(s)); }22signed char HexDigit(char c);24#endif // BITCOIN_CRYPTO_HEX_BASE_H