-
Notifications
You must be signed in to change notification settings - Fork 0
/
hash_map.h
82 lines (51 loc) · 1.51 KB
/
hash_map.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//
// hash_map.h
// ReverseMD5Metal
//
// Created by Cameron Monks on 7/16/19.
// Copyright © 2019 Cameron Monks. All rights reserved.
//
#ifndef hash_map_h
#define hash_map_h
#define thread
#define MAX_PASSWORD_CHARACTERS 16
//#include <stdio.h>
#include <stdlib.h>
/*
#include <assert.h>
#include <string.h>
*/
typedef enum { false, true } bool;
// MARK: Node
typedef struct Node {
char * value;
struct Node* next;
} Node;
Node* NodeInit(char *str);
Node* NodeAdd(Node *self, char *str, bool allowDuplicates);
bool NodeContains(const Node *self, const char *str);
void NodePrint(const Node *self);
unsigned NodeCount(const Node *self);
char * NodeToCharArray(const Node *self);
// MARK: HashSet
typedef struct {
Node ** arr;
unsigned count;
unsigned size;
} HashSet;
HashSet* HashSetInit(unsigned size);
bool HashSetAdd(HashSet *self, char * str);
bool HashSetContains(const HashSet *self, const char *str);
void HashSetPrint(const HashSet* self);
// MARK: HashSet Array
unsigned HashSetToArraySize(const HashSet* self);
unsigned* HashSetToArray(const HashSet* self);
bool HashSetArrayContains(const unsigned* arr, const char * str);
// MARK: Integer Formsat
char* IntegerToAsci(unsigned long i, const Node* n);
char* IntegerToAsciTwo(unsigned long i, const char * arr);
// MARK: MD5
#define thread
void md52(thread int8_t *initial_msg, size_t initial_len, thread char * encryptedMDMsg);
//void md5(thread const char *msg, unsigned mlen, thread char * answer);
#endif /* hash_map_h */