This file is indexed.

/usr/include/modp_b2.h is in libmodpbase64-dev 3.10.3+git20160924-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/**
 * \file modp_b2.h
 * \brief Encode and decode of base 2 strings ("00001110" to 0x43)
 *
 */

/*
 * <PRE>
 * MODP_B2 -- Base 2 (binary) encode/decoder
 * https://github.com/client9/stringencoders
 *
 * Copyright &copy; 2007-2016, Nick Galbreath
 * All rights reserved.
 *
 * Released under MIT license.  See LICENSE for details.
 * </PRE>
 *
 */

#ifndef COM_MODP_STRINGENCODERS_B2
#define COM_MODP_STRINGENCODERS_B2

#ifdef __cplusplus
extern "C" {
#endif
#include "modp_stdint.h"

/**
 * encode a string into binary (base 2, '0' and '1')
 *
 * \param[out] dest the output string.  Must have at least modp_b16_encode_len
 *   bytes allocated
 * \param[in] str the input string
 * \param[in] len of the input string
 * \return strlen of dest
 */
size_t modp_b2_encode(char* dest, const char* str, size_t len);

/**
 * Decode a hex-encoded string.
 *
 * \param[out] dest output, must have at least modp_b16_decode_len bytes allocated,
 *   input must be a multiple of 2, and be different than the source buffer.
 * \param[in] src the hex encoded source
 * \param[in] len the length of the source
 * \return the length of the the output, or 0 if an error (input size not a multiple of 8)
 */
size_t modp_b2_decode(char* dest, const char* src, size_t len);

/**
 * Encode length.
 * 2 x the length of A, round up the next high multiple of 2
 * +1 for null byte added
 */
#define modp_b2_encode_len(A) (8 * A + 1)

/**
 * Encode string length
 */
#define modp_b2_encode_strlen(A) (8 * A)

/**
 * Decode string length
 */
#define modp_b2_decode_len(A) ((A + 1) / 8)

#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
#include <string>

namespace modp {
/**
     * hex encode a string (self-modified)
     * \param[in,out] s the input string to be encoded
     * \return a reference to the input string.
     */
inline std::string& b2_encode(std::string& s)
{
    std::string x(modp_b2_encode_len(s.size()), '\0');
    size_t d = modp_b2_encode(const_cast<char*>(x.data()), s.data(), s.size());
    if (d == (size_t)-1) {
        x.clear();
    } else {
        x.erase(d, std::string::npos);
    }
    s.swap(x);
    return s;
}

/**
     *
     * \param[in] s original data source
     * \return new b2 encoding string
     */
inline std::string b2_encode(const std::string& s)
{
    std::string str(s);
    b2_encode(str);
    return str;
}

/**
     * Decode a hex-encoded string.  On error, input string is cleared.
     * This function does not allocate memory.
     *
     * \param[in,out] s the input string
     * \return a reference to the input string
     */
inline std::string& b2_decode(std::string& s)
{
    size_t d = modp_b2_decode(const_cast<char*>(s.data()), s.data(), s.size());
    if (d == (size_t)-1) {
        s.clear();
    } else {
        s.erase(d, std::string::npos);
    }
    return s;
}

inline std::string b2_decode(const std::string& s)
{
    std::string x(s);
    b2_decode(x);
    return x;
}

} /* namespace modp */

#endif /* cplusplus */

#endif /* ifndef modp_b2 */