|
1 2 3 4 5 6 7 8 9 10 11 |
"Version": "2012-10-17", "Statement": [ { "Action": [ "dynamodb:DeleteTable" ], "Effect": "Deny", "Resource": "*" } ] } |
Page 2 of 24
What is a hash function
A hash function is a function that takes in input value, and from that input value creates an output value deterministic of the input value. For any x input value, you will always receive the same y output value when the hash function is run. In this way, every input has a determined output.
f(x) = y
As an example we will use the MD5 hash function. You can try on the online generator at md5hashgenerator.com. This function, which from any input data creates a 32 character hexadecimal output. Hash functions are generally irreversible (one-way), which means you can’t figure out the input if you only know the output – unless you try every possible input (which is called a brute-force attack).
md5(‘hash me’) = 17b31dce96b9d6c6d0a6ba95f47796fb
If you go to the generator page and input ‘hash me’ it should output the value above.
How a hash function is used in DynamoDB
The primary key or a combination of the primary key and sort key will be used as input value to an internal hash function. AWS does not revel how the algorithm works for their hash function. The output value is like the example above. AWS will determine from the output value how and where to partition and store an item. The algorithm can use the first 4 characters or any number to determine the partition(s). I found simple explanation on a forum here.
I will occasionally write posts on medium, check out the latest one.
How to convert a Binary IP to an IP address
© 2019 Aldomatic
Theme by Anders Noren — Up ↑
