11 -- Steve Reid <steve@edmweb.com>
12 Small changes to fit into bglibs
13 -- Bruce Guenter <bruce@untroubled.org>
14 Translation to simpler C++ Code
15 -- Volker Grabsch <vog@notjusthosting.com>
16 Fixing bugs and improving style
17 -- Eugene Hopkinson <slowriot at voxelstorm dot com>
32 void update(const std::string
&s
);
33 void update(std::istream
&is
);
35 static std::string
from_file(const std::string
&filename
);
38 static constexpr unsigned int DIGEST_INTS
= 5; /* number of 32bit integers per SHA1 digest */
39 static constexpr unsigned int BLOCK_INTS
= 16; /* number of 32bit integers per SHA1 block */
40 static constexpr unsigned int BLOCK_BYTES
= BLOCK_INTS
* 4;
42 uint32_t digest
[DIGEST_INTS
];
47 void transform(uint32_t block
[BLOCK_BYTES
]);
49 static void read(std::istream
&is
, std::string
&s
, size_t max
);
50 static void buffer_to_block(const std::string
&buffer
, uint32_t block
[BLOCK_INTS
]);
53 std::string
sha1(const std::string
&string
);