add hamming_distance
All checks were successful
Test and Deploy / test (push) Successful in 13s
Test and Deploy / docs (push) Successful in 21s

This commit is contained in:
2024-05-05 17:05:12 -07:00
parent c81c8bfa3c
commit 89a3585c7f
4 changed files with 22 additions and 4 deletions

View File

@ -92,8 +92,16 @@ const unsigned char *repeating_key_xor_s(const char* s, const char* key);
### hamming_distance
Calculates the Hamming Distance (the number of differing bits) between two arrays of unsigned bytes
```c
unsigned int hamming_distance(unsigned char *a, unsigned char *b);
```
### hamming_distance_s
Calculates the Hamming Distance (the number of differing bits) between two strings
```c
unsigned int hamming_distance(const char *a, const char *b);
unsigned int hamming_distance_s(const char *a, const char *b);
```