This commit is contained in:
Miloslav Ciz 2022-03-16 17:34:02 +01:00
parent b0653cd555
commit 61d3471ce6
2 changed files with 15 additions and 1 deletions

14
hash.md Normal file
View file

@ -0,0 +1,14 @@
# Hash
Hash is a number computed by a **hash function**, a function that takes some data and turns it into a number (the hash) that's much smaller than the data itself, has a fixed size (number of [bits](bit.md)) and which has additional properties such as being completely different from hash values computed from very similar data. Thanks to these properties hashes have a very wide use in [computer science](compsci.md) -- they are often used to quickly compare whether two pieces of non-small data, such as documents, are the same, they are used in indexing structures such as **hash tables** which allow for quick search of data, and they find a great use in [cryptocurrencies](crypto.md) and [security](security.md), e.g. for [digital signatures](sigital_signature.md). Hashing is extremely important and as a programmer you won't be able to avoid encountering hashes somewhere in the wild.
It is generally given that a hash (or hash function) should satisfy the following criteria:
- **Have fixed size** (given in bits), even for data that's potentially of variable size (e.g. text strings).
- **Be fast to compute**. This is mostly important for non-security uses, cryptographic hashes may prioritize other properties to guarantee the hash safety.
- **Have uniform mapping**. That is if we hash a lot of different data the hashes we get should be uniformly spread over the space of the hashes, i.e. NOT be centered around some number. This is in order for hash tables to be balanced, and it's also required in security (non-uniform hashes can be easier to reverse).
- **Behave in a [chaotic](chaos.md) manner**, i.e. hashes of similar data should be completely different. This is similar to the point above; a hash should kind of appear as a "random" number associated to the data (but of course, the hash of the same data has to always be the same when computed repeatedly, i.e. be [deterministic](determinism.md)). So if you change just one bit in the hashed data, you should get a completely different hash from it.
- **Minimize collision**, i.e. the probability of two different values giving the same hash. Mathematically collisions are always possible if we're mapping a big space onto a smaller one, but we should try to reduce collisions that happen in practice. This property should follow from the principle of uniformity and chaotic behavior mentioned above.
- **Be difficult to reverse** (mainly for security related hashes). Lots of times this comes naturally from the fact that a hash maps a big space onto a smaller space (i.e. it is a non-[injective](injective.md) function). Hashes can typically be reversed only by [brute force](brute_force.md).
TODO: example, hash tables, uses

View file

@ -6,7 +6,7 @@ Specific practices used in marketing are:
- **Lies** and falsehoods. Every ad will present the product as the best, even though not all products can be best. Actors will be paid to lie about how the product changed their life etc. Many times numbers and "facts" whose source is difficult to trace will be completely made up. **Fake discounts** are something constantly presented in ads.
- **Extreme repetition**: this includes repeating the same commercial over and over (e.g. every 10 minutes) as well as repeating the name of the product in a completely retarded way (*"We recommend X because X is the best. For more info about X visit www.X.com. Remember, X is the best. Your X."*).
- **Psychological tricks** such as **abusing songs** and shitty catchy melodies, often raping existing good music by for example changing the lyrics. This abuses the fact that a song will stick in one's head and keep torturing the person into thinking about the advertised product constantly. Other tricks include for example **fake empathy** ("we care about your" etc.).
- **Psychological tricks** such as **abusing songs** and shitty catchy melodies, often raping existing good music by for example changing the lyrics. This abuses the fact that a song will stick in one's head and keep torturing the person into thinking about the advertised product constantly. Other tricks include **shouting** or **fake empathy** ("we care about your" etc.).
- **Misleading statistics**, presentation and interpretation of data. For example any success rate will be presented as the upper bound as such a number will be higher, typically 99% or 100%, i.e. *"our product is successful in up to 100% cases!"* (which of course gives zero information and only says the product won't succeed in more than 100% cases). A company may also run its own competition for a "best product", e.g. on [Facebook](facebook.md), in which all products are of course their products, and then the winning product will be seen on TV as a "contest winning product".
- **Forcefully seizing attention**: ads are present practically everywhere, even embedded in "art" (even in that one pays for), in the sky (planes and blimps, ...), they play on every radio you hear in every shop, they pop up on electronic devices one paid for, they can't be turned off. They are present in education materials and targeted at children. Audio of a commercial will be made louder to catch an attention when it starts playing on a commercial break.
- **Bribing celebrities/influencers**. An *influencer* is nowadays a culturally accepted "job" whose sole work consists of lying, forcing products and spreading corporate propaganda.