I am beginner in cryptography, but I want to make a simple hash code function in C. My concept is, I have a string "helloiam"
and a integer 433
. Can I convert the string in to encrypted format like "233ASDJJ6688FGSS"
something like that?
I don't know unsigned integer or 128 bit integer format. Any simple code to convert string using a integer to form a hash code. I generate that unique integer for every string. But I want to use this integer on the string to form a hash code like "233ASDJJ6688FGSS"
.
How can I make this?
Any sample code in C?
I don't want to make complex algorithms for making hash code. I am try to make my own.
Asked
Active
Viewed 444 times
0
-
Why do you need an additional integer in hashing? Maybe you want to encrypt it instead of making a hash? – Chan Kha Vu Apr 24 '15 at 06:34
2 Answers
1
Try CRC32: Can CRC32 be used as a hash function?
Few other options at http://en.wikipedia.org/wiki/List_of_hash_functions
1
Hash function can only give you more or less long integer values, the format with character is a formatting of the integer, like converting it to a string or formatting it with printf
Some well known integer formatting available are :
- binary (base 2)
- octal (base 8)
- decimal ( base 10 )
- hexadecimal ( base 16)
- base64
...
you can of course roll your own by choosing a base for your number, meaning how many characters are in your figures list to write your number.
You can then write a correspondence table to match the number with the correct character.

dvhh
- 4,724
- 27
- 33