Inside Bitcoin
Opening the selected file…
Inside Bitcoin
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-2010 Satoshi Nakamoto2// Copyright (c) 2009-present The Bitcoin Core developers3// Distributed under the MIT software license, see the accompanying4// file COPYING or http://www.opensource.org/licenses/mit-license.php.6#include <uint256.h>8#include <util/strencodings.h>10template <unsigned int BITS>11std::string base_blob<BITS>::GetHex() const12{13uint8_t m_data_rev[WIDTH];14for (int i = 0; i < WIDTH; ++i) {15m_data_rev[i] = m_data[WIDTH - 1 - i];16}17return HexStr(m_data_rev);18}20template <unsigned int BITS>21std::string base_blob<BITS>::ToString() const22{23return (GetHex());24}26// Explicit instantiations for base_blob<160>27template std::string base_blob<160>::GetHex() const;28template std::string base_blob<160>::ToString() const;30// Explicit instantiations for base_blob<256>31template std::string base_blob<256>::GetHex() const;32template std::string base_blob<256>::ToString() const;34const uint256 uint256::ZERO(0);35const uint256 uint256::ONE(1);