Changeset View
Changeset View
Standalone View
Standalone View
src/crypto/common.h
// Copyright (c) 2014 The Bitcoin Core developers | // Copyright (c) 2014 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_CRYPTO_COMMON_H | #ifndef BITCOIN_CRYPTO_COMMON_H | ||||
#define BITCOIN_CRYPTO_COMMON_H | #define BITCOIN_CRYPTO_COMMON_H | ||||
#if defined(HAVE_CONFIG_H) | #if defined(HAVE_CONFIG_H) | ||||
#include "bitcoin-config.h" | #include "bitcoin-config.h" | ||||
#endif | #endif | ||||
#include <stdint.h> | #include <cstdint> | ||||
#include <string.h> | #include <cstring> | ||||
#include "compat/endian.h" | #include "compat/endian.h" | ||||
uint16_t static inline ReadLE16(const unsigned char *ptr) { | uint16_t static inline ReadLE16(const unsigned char *ptr) { | ||||
uint16_t x; | uint16_t x; | ||||
memcpy((char *)&x, ptr, 2); | memcpy((char *)&x, ptr, 2); | ||||
return le16toh(x); | return le16toh(x); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |