MCPcopy Create free account
hub / github.com/ElementsProject/elements / ReadBE64

Function ReadBE64

src/simplicity/sha256.h:19–28  ·  view source on GitHub ↗

Packs (the 8 least significant bits of) 8 'unsigned char's into a 'uint_fast64_t' in "big endian" order. * * Precondition: unsigned char b[8] */

Source from the content-addressed store, hash-verified

17 * Precondition: unsigned char b[8]
18 */
19static inline uint_fast64_t ReadBE64(const unsigned char* b) {
20 return (uint_fast64_t)(b[0] & 0xff) << 56
21 | (uint_fast64_t)(b[1] & 0xff) << 48
22 | (uint_fast64_t)(b[2] & 0xff) << 40
23 | (uint_fast64_t)(b[3] & 0xff) << 32
24 | (uint_fast64_t)(b[4] & 0xff) << 24
25 | (uint_fast64_t)(b[5] & 0xff) << 16
26 | (uint_fast64_t)(b[6] & 0xff) << 8
27 | (uint_fast64_t)(b[7] & 0xff);
28}
29
30/* Packs (the 8 least significant bits of) 4 'unsigned char's into a 'uint32_t' in "big endian" order.
31 *

Callers 1

copyRawAmtFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected