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

Function WriteLE32

src/simplicity/sha256.h:71–76  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

69 * Precondition: unsigned char ptr[4]
70 */
71static inline void WriteLE32(unsigned char* ptr, uint_fast32_t x) {
72 ptr[3] = (unsigned char)(0xff & x >> 24);
73 ptr[2] = 0xff & x >> 16;
74 ptr[1] = 0xff & x >> 8;
75 ptr[0] = 0xff & x;
76}
77
78/* Converts a given 'midstate' value to a 'hash' value as 32 bytes stored in an unsigned char array.
79 *

Callers 2

sha256_u32leFunction · 0.70
CScriptClass · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected