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

Function FastRange32

src/util/fastrange.h:19–22  ·  view source on GitHub ↗

Fast range reduction with 32-bit input and 32-bit range. */

Source from the content-addressed store, hash-verified

17
18/** Fast range reduction with 32-bit input and 32-bit range. */
19static inline uint32_t FastRange32(uint32_t x, uint32_t n)
20{
21 return (uint64_t{x} * n) >> 32;
22}
23
24/** Fast range reduction with 64-bit input and 64-bit range. */
25static inline uint64_t FastRange64(uint64_t x, uint64_t n)

Callers 3

compute_hashesMethod · 0.85
insertMethod · 0.85
containsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected