diff options
Diffstat (limited to 'csum-file.h')
-rw-r--r-- | csum-file.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/csum-file.h b/csum-file.h index 9dedb038ea..da612c59c1 100644 --- a/csum-file.h +++ b/csum-file.h @@ -39,4 +39,15 @@ extern void sha1flush(struct sha1file *f); extern void crc32_begin(struct sha1file *); extern uint32_t crc32_end(struct sha1file *); +static inline void sha1write_u8(struct sha1file *f, uint8_t data) +{ + sha1write(f, &data, sizeof(data)); +} + +static inline void sha1write_be32(struct sha1file *f, uint32_t data) +{ + data = htonl(data); + sha1write(f, &data, sizeof(data)); +} + #endif |