ATLAS Offline Software
Namespaces | Classes | Typedefs | Functions
picosha2 Namespace Reference

Namespaces

 detail
 
 impl
 

Classes

class  hash256_one_by_one
 

Typedefs

typedef unsigned long word_t
 
typedef unsigned char byte_t
 

Functions

template<typename InIter >
void output_hex (InIter first, InIter last, std::ostream &os)
 
template<typename InIter >
void bytes_to_hex_string (InIter first, InIter last, std::string &hex_str)
 
template<typename InContainer >
void bytes_to_hex_string (const InContainer &bytes, std::string &hex_str)
 
template<typename InIter >
std::string bytes_to_hex_string (InIter first, InIter last)
 
template<typename InContainer >
std::string bytes_to_hex_string (const InContainer &bytes)
 
void get_hash_hex_string (const hash256_one_by_one &hasher, std::string &hex_str)
 
std::string get_hash_hex_string (const hash256_one_by_one &hasher)
 
template<typename InIter , typename OutIter >
void hash256 (InIter first, InIter last, OutIter first2, OutIter last2, int buffer_size=PICOSHA2_BUFFER_SIZE_FOR_INPUT_ITERATOR)
 
template<typename InIter , typename OutContainer >
void hash256 (InIter first, InIter last, OutContainer &dst)
 
template<typename InContainer , typename OutIter >
void hash256 (const InContainer &src, OutIter first, OutIter last)
 
template<typename InContainer , typename OutContainer >
void hash256 (const InContainer &src, OutContainer &dst)
 
template<typename InIter >
void hash256_hex_string (InIter first, InIter last, std::string &hex_str)
 
template<typename InIter >
std::string hash256_hex_string (InIter first, InIter last)
 
void hash256_hex_string (const std::string &src, std::string &hex_str)
 
template<typename InContainer >
void hash256_hex_string (const InContainer &src, std::string &hex_str)
 
template<typename InContainer >
std::string hash256_hex_string (const InContainer &src)
 
template<typename OutIter >
void hash256 (std::ifstream &f, OutIter first, OutIter last)
 

Typedef Documentation

◆ byte_t

typedef unsigned char picosha2::byte_t

Definition at line 41 of file picosha2.h.

◆ word_t

typedef unsigned long picosha2::word_t

Definition at line 40 of file picosha2.h.

Function Documentation

◆ bytes_to_hex_string() [1/4]

template<typename InContainer >
std::string picosha2::bytes_to_hex_string ( const InContainer &  bytes)

Definition at line 178 of file picosha2.h.

178  {
179  std::string hex_str;
180  bytes_to_hex_string(bytes, hex_str);
181  return hex_str;
182  }

◆ bytes_to_hex_string() [2/4]

template<typename InContainer >
void picosha2::bytes_to_hex_string ( const InContainer &  bytes,
std::string &  hex_str 
)

Definition at line 166 of file picosha2.h.

166  {
167  bytes_to_hex_string(bytes.begin(), bytes.end(), hex_str);
168  }

◆ bytes_to_hex_string() [3/4]

template<typename InIter >
std::string picosha2::bytes_to_hex_string ( InIter  first,
InIter  last 
)

Definition at line 171 of file picosha2.h.

171  {
172  std::string hex_str;
173  bytes_to_hex_string(first, last, hex_str);
174  return hex_str;
175  }

◆ bytes_to_hex_string() [4/4]

template<typename InIter >
void picosha2::bytes_to_hex_string ( InIter  first,
InIter  last,
std::string &  hex_str 
)

Definition at line 159 of file picosha2.h.

159  {
160  std::ostringstream oss;
161  output_hex(first, last, oss);
162  hex_str.assign(oss.str());
163  }

◆ get_hash_hex_string() [1/2]

std::string picosha2::get_hash_hex_string ( const hash256_one_by_one hasher)
inline

Definition at line 289 of file picosha2.h.

289  {
290  std::string hex_str;
291  get_hash_hex_string(hasher, hex_str);
292  return hex_str;
293  }

◆ get_hash_hex_string() [2/2]

void picosha2::get_hash_hex_string ( const hash256_one_by_one hasher,
std::string &  hex_str 
)
inline

Definition at line 281 of file picosha2.h.

282  {
283  byte_t hash[k_digest_size];
284 
285  hasher.get_hash_bytes(hash, hash + k_digest_size);
286  return bytes_to_hex_string(hash, hash + k_digest_size, hex_str);
287  }

◆ hash256() [1/5]

template<typename InContainer , typename OutContainer >
void picosha2::hash256 ( const InContainer &  src,
OutContainer &  dst 
)

Definition at line 348 of file picosha2.h.

348  {
349  hash256(src.begin(), src.end(), dst.begin(), dst.end());
350  }

◆ hash256() [2/5]

template<typename InContainer , typename OutIter >
void picosha2::hash256 ( const InContainer &  src,
OutIter  first,
OutIter  last 
)

Definition at line 343 of file picosha2.h.

343  {
344  hash256(src.begin(), src.end(), first, last);
345  }

◆ hash256() [3/5]

template<typename InIter , typename OutContainer >
void picosha2::hash256 ( InIter  first,
InIter  last,
OutContainer &  dst 
)

Definition at line 338 of file picosha2.h.

338  {
339  hash256(first, last, dst.begin(), dst.end());
340  }

◆ hash256() [4/5]

template<typename InIter , typename OutIter >
void picosha2::hash256 ( InIter  first,
InIter  last,
OutIter  first2,
OutIter  last2,
int  buffer_size = PICOSHA2_BUFFER_SIZE_FOR_INPUT_ITERATOR 
)

Definition at line 330 of file picosha2.h.

331  {
333  first, last, first2, last2, buffer_size,
334  typename std::iterator_traits<InIter>::iterator_category());
335  }

◆ hash256() [5/5]

template<typename OutIter >
void picosha2::hash256 ( std::ifstream &  f,
OutIter  first,
OutIter  last 
)

Definition at line 383 of file picosha2.h.

383  {
384  hash256(std::istreambuf_iterator<char>(f), std::istreambuf_iterator<char>(), first, last);
385  }

◆ hash256_hex_string() [1/5]

template<typename InContainer >
std::string picosha2::hash256_hex_string ( const InContainer &  src)

Definition at line 379 of file picosha2.h.

379  {
380  return hash256_hex_string(src.begin(), src.end());
381  }

◆ hash256_hex_string() [2/5]

template<typename InContainer >
void picosha2::hash256_hex_string ( const InContainer &  src,
std::string &  hex_str 
)

Definition at line 374 of file picosha2.h.

374  {
375  hash256_hex_string(src.begin(), src.end(), hex_str);
376  }

◆ hash256_hex_string() [3/5]

void picosha2::hash256_hex_string ( const std::string &  src,
std::string &  hex_str 
)
inline

Definition at line 369 of file picosha2.h.

369  {
370  hash256_hex_string(src.begin(), src.end(), hex_str);
371  }

◆ hash256_hex_string() [4/5]

template<typename InIter >
std::string picosha2::hash256_hex_string ( InIter  first,
InIter  last 
)

Definition at line 363 of file picosha2.h.

363  {
364  std::string hex_str;
365  hash256_hex_string(first, last, hex_str);
366  return hex_str;
367  }

◆ hash256_hex_string() [5/5]

template<typename InIter >
void picosha2::hash256_hex_string ( InIter  first,
InIter  last,
std::string &  hex_str 
)

Definition at line 353 of file picosha2.h.

353  {
354  byte_t hashed[k_digest_size];
355 
356  hash256(first, last, hashed, hashed + k_digest_size);
357  std::ostringstream oss;
358  output_hex(hashed, hashed + k_digest_size, oss);
359  hex_str.assign(oss.str());
360  }

◆ output_hex()

template<typename InIter >
void picosha2::output_hex ( InIter  first,
InIter  last,
std::ostream &  os 
)

Definition at line 147 of file picosha2.h.

147  {
148  os.setf(std::ios::hex, std::ios::basefield);
149  while (first != last) {
150  os.width(2);
151  os.fill('0');
152  os << static_cast<unsigned int>(*first);
153  ++first;
154  }
155  os.setf(std::ios::dec, std::ios::basefield);
156  }
picosha2::hash256_hex_string
std::string hash256_hex_string(const InContainer &src)
Definition: picosha2.h:379
picosha2::get_hash_hex_string
std::string get_hash_hex_string(const hash256_one_by_one &hasher)
Definition: picosha2.h:289
picosha2::byte_t
unsigned char byte_t
Definition: picosha2.h:41
WriteCellNoiseToCool.src
src
Definition: WriteCellNoiseToCool.py:513
picosha2::impl::hash256_impl
void hash256_impl(RaIter first, RaIter last, OutIter first2, OutIter last2, int, std::random_access_iterator_tag)
Definition: picosha2.h:297
picosha2::bytes_to_hex_string
std::string bytes_to_hex_string(const InContainer &bytes)
Definition: picosha2.h:178
picosha2::hash256
void hash256(std::ifstream &f, OutIter first, OutIter last)
Definition: picosha2.h:383
hist_file_dump.f
f
Definition: hist_file_dump.py:135
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
DeMoScan.first
bool first
Definition: DeMoScan.py:536
picosha2::output_hex
void output_hex(InIter first, InIter last, std::ostream &os)
Definition: picosha2.h:147