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

Function WriteBE32

src/simplicity/sha256.h:60–65  ·  view source on GitHub ↗

Unpacks 4 bytes from a 'uint_fast32_t' into an 'unsigned char' array in "big endian" order. * * Precondition: unsigned char ptr[4] */

Source from the content-addressed store, hash-verified

58 * Precondition: unsigned char ptr[4]
59 */
60static inline void WriteBE32(unsigned char* ptr, uint_fast32_t x) {
61 ptr[0] = (unsigned char)(x >> 24);
62 ptr[1] = (x >> 16) & 0xff;
63 ptr[2] = (x >> 8) & 0xff;
64 ptr[3] = x & 0xff;
65}
66
67/* Unpacks 4 bytes from a 'uint_fast32_t' into an 'unsigned char' array in "little endian" order.
68 *

Callers 2

sha256_fromMidstateFunction · 0.70
sha256_u32beFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected