Skip to content

matthew01lokiet/hashing-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hashing-library

Default Pipeline

Hashing library written in C; consists of 6 hashing functions and one bonus:

  • SHA-256
  • SHA-224
  • SHA-1
  • SHA-0
  • MD-5
  • MD-4
  • ROT-13

Usage Example

#include <stdio.h>
#include <stdlib.h>
#include "hashing.h"

int main() {

    // hashed "test" value with SHA-224
    uint8_t test_value[] = {'t', 'e', 's', 't'};
    uint32_t* hash = Hashing.sha_224(test_value,4);

    // If some problem, NULL value will get returned
    if(hash == NULL){
        return 1;
    }

    for(int i = 0; i < 7; i++){
        printf("%#010x ", hash[i]);
    }
    printf("\n");
    // Remember about freeing memory allocated for the hash!
    free(hash);

    return 0;
}