mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-06-30 09:06:53 +08:00
clang-format and clang-tidy fixes for 86e65fe8
This commit is contained in:
@@ -38,19 +38,20 @@ namespace sha256 {
|
||||
* @param padded_input_size Size of the padded input
|
||||
* @return char Character at the index pos in the padded string
|
||||
*/
|
||||
char get_char(const std::string input, std::size_t pos,
|
||||
char get_char(const std::string &input, std::size_t pos,
|
||||
size_t padded_input_size) {
|
||||
size_t input_size = input.length();
|
||||
char ch;
|
||||
if (pos < input_size)
|
||||
char ch = 0;
|
||||
if (pos < input_size) {
|
||||
ch = input[pos];
|
||||
else if (pos == input_size)
|
||||
} else if (pos == input_size) {
|
||||
ch = '\x80';
|
||||
else if (pos < padded_input_size - 8)
|
||||
} else if (pos < padded_input_size - 8) {
|
||||
ch = '\x00';
|
||||
else
|
||||
} else {
|
||||
ch =
|
||||
static_cast<char>((input_size * 8 >> (56 - (pos % 56) * 8)) & 0xFF);
|
||||
}
|
||||
return ch;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user