Hash Collision Considerations

In computing theory Collision is described as the event where two objects or records receive the same identifier or allocation in memory. The description also applies when one algorithm produces the same hash value for different entries. An algorithm considered robust must have as fundamental characteristic the “pairwise independence” , which in a simplified way means that the hash generated from two distinct entries must be different.

The hash functions do not have methods that allow the identification of the input items, or registration of the hash values ​​generated from them. This means that although the pairwise independence feature is desirable and extremely necessary, collision is statistically possible since there are unlimited inputs and a limited (although incredibly big) number of possible outputs. The probability of collision is directly related to the composition (characters) and the size of the hash value. The greater the size of the hash value, the more difficult becomes the collision. The use of the word difficult and not impossible is adequate because the growth of computing power makes the calculations necessary to find these values ​​more accessible. To illustrate how the collision works, consider a hash function represented by H, and any input value, for example, “Hello”, which as a result generates a hash value, 7878​654, consisting of 7 (seven) characters numbers. Having the equivalent function:

H(Hello) =  7878​654 

The collision could happen when, for the same hash function H and a different entry, for example, “World”, the result generated is the same as that obtained for the entry “Hello” .

H(World) =  7878​654 

Google Home speaks portuguese! So do we!

It is almost a year since I bought the Google Home device for my personal use. I bought the Google mini and a alternative version of the Google Home called Insignia just because it had a watch.

My kids just looooved the thing.. it was a great incentive for them to speak English and train their vocabulary.. you know ask for musics, small tasks, ask for address and such. But what I noticed was that after a while, they kept asking the same things from memory.. it wasn’t like they were actually learning anything new. And there was no way to change the language because back then it only spoke a few languages, like french and Spanish.. but no Portuguese.

But, I just noticed that after the latest update and the app revamp , Portuguese was available. It is just easier for the kids and wife to interact with the assistant now and we are really having fun!

Another upgrade is that for some reason the network driver of the Google home devices was not so good, it kept loosing the wifi signal and we often asked for something and it replied with something like  “Sorry, there seems to have a problem with the network”. It was not showing up in Spotify as a possible device connection and a reboot would have to be done to have it available again.. now it is everywhere.. connection simply works!

Are you giving up Facebook too? Here’s my reasons

It was around 3 years ago when I suddenly realized that a friend of mine had gone from Facebook. I don’t remember exactly why I was looking for him, but I just couldn’t find the guy. Went for looking for him in the messenger app and nothing, searched by his phone number, nothing.. it did take a while until I realized that he actually deleted his account from the platform. Why? Why anybody with sane mind would do such a thing? I mean, really?

The tool is really amazing!!  It does connect you with that friend that you lost contact with ages ago. You can share your travel adventures or share not only your problems but your happiness. You can sell stuff, promote your business or simply read about people’s life. You can call people to act on a cause or promote a healthy debate about something. Don’t even get me started on theall the babies, birthdays and companies parties pictures that you can see. I can’t number the ways that you could positively use Facebook, it is just too many. And because of those reasons I thought badly of that particular friend. I considered him crazy and associated his disappearance to religion – He was actually studying and getting very involved into meditation and mind control stuff. Why would anybody not want to have this in their life? The thing is sooo addictive, and comes along with the feeling of community that makes you feel alone if you don’t participate of it, it is like you don’t have a voice or even if you don’t exist without it, isn’t t?

Fast forward to the present moment I found myself wondering if the platform is actually that good. With the recent change on Facebook algorithm the feed of stuff you end up seeing is so, so toxic! It has the goal of showing you more content from family and friends and according to Mark the focus should be people’s well being.

“You’ll see less public content like posts from businesses, brands, and media. And the public content you see more will be held to the same standard—it should encourage meaningful interactions between people.”

Come on, be honest with yourself, have you really felt good about it? The change actually made the thing to be worse. You are doomed to see the posts over and over, and doesn’t matter how many times you come back to it or device you use. It has a huge impact on marketing and ads, but also on the quality of the content you ended up seeing. Additionally there are numerous scandals that have been striking Facebook and its users with data leakage and privacy violations. Do you remember the USA elections and the avalanche of fake news? And even suspicious of Facebook selling your data to third party companies… not really a surprise, but you know… it is kinda of a bummer.

If none of that is enough reason for you to delete or stop using Facebook I can give the reason that made me think about it.

The bubble effect

The changes of the News feed algorithm favors people content like photos, events and frivolous things that it considers important. Ultimately you are trapped seeing only things that doesn’t necessarily bring any value or knowledge. The other side of it has nothing to do with the algorithm but has a lot to do with human nature where most of us try to avoid confrontation or a different opinion. Facebook really makes it easy to simply stop following that person, or block him for good. If the guy is posting to many posts related to porn, block him! If he or her has a political view that is completely different from mine.. block them! If the lady is sharing too much of her travelings and veggie recipes.. what do you do? Yes! Hit that lovely button and stop following that salad eater.

Without realizing, you are only seeing things that you like, with people that you tolerate and living in a bubble that brings no difference or diversity. The bubble is no good for anyone!  It will inevitably drag you to the hate side, being it the second reason I’m getting away from Facebook.

The hate effect

Internet gives people a voice! Unfortunately the ratio of mouth and ears distribution is not that proportional. People are way more interested in saying than listening. Politics, movies, games, gay marriage, affirmative actions, immigration, guns control, abortion, adoption, divorce, human rights, minorities, civil law, criminal law…you get the idea. All topics, in my opinion, amazingly good to attract and involve people in a productive discussion where arguments are given and a healthy debate is built. But that is not what we see. Yes, internet gives you a voice but, also provides a place to hide, where you can share your stupidity and not be held responsible for it. More often than not, the so called haters can disseminate their poison and absolutely nothing happens. They get used to it.. and hate becomes their hobby.

I can’t forget one day that I had just finished the São Silvestre race and was so proud about it that I felt like sharing. I hadn’t payed the subscription and as you may suppose was not entitled to receive the medal. So, I borrowed the medal from a fellow runner and took the picture. No biggie, right? I had run the 15KM, just like anybody else.

Took exactly 2 minutes after sharing the picture to have the idiots picking on the fact that the medal wasn’t mine. 15 bloody kilometers on December 31st and so many decent things to say..and the jerks were there to judge and to spread the hate… Nope, not for me!

The envy effect

This one goes both ways. We want to check on peoples life and see what they are up to. And we also want to have people checking what we are up.. that is why we make an effort to show that our very boring festivities look like a Woodstock type of event and share the cool aspects of our life. Bottom line is, it becomes a competition to see who is the happiest, or traveled the most, or partied the most or have more success in life.  We all know, no one’s life is perfect. We have down sides, we feel under the water more often than we would like it to admit. But we share only the good things…it makes me feel bad! I have the impression that the neighbor’s garden is always better than mine ( This is actually an expression in Portuguese). As people is always sharing their good moments, what was supposed to be a positive thing actually has the opposite effect. It feels like everybody is happy, super successful but me. It is freaking depressive!


One thing that must be clear as I open the door of my criticism towards Facebook is that it is a great tool. It has great qualities and I’m sure it has a place in many peoples stories of success and surely some love ones. But for me, I was simply tired of the hate, the envy and the bubble effect. I like a good conversation, I like a good debate.. even a heated but polite one. I like sharing and talking about my success. But I feel, it is not to be shared with everyone. The friendship concept promoted by Facebook is overrated, it is lazy friendship. People that actually care about you will call you in your birthdays, or will show up to help you with that home project of yours… they won’t be satisfied with a simple like in a photo that you shared, they will die to be with you during those moments. You will certainly fight with your true friends, but then you will make peace over a coffee and an awkward apology request.. or no apologies at all.. just a hug or a embarrassed look that you will understand.  True friendship will cheer and be excited about your success.. gosh they will lend you money if they know it is to help you to live a dream or start a new business… or if you are just dead broke. They will be pissed at you whenever you screw up and they will tell you the truth… Facebook doesn’t give me that..

I invested many hours of my life,  sharing thoughts, uploading pictures and commenting on Facebook… it is nice they provide a way for you to backup everything and download what you have there. It is quite easy to erase your account and be done with it.  Not ready to delete the account entirely? I’m certainly not there yet, but I’m glad I’m not using it that much anymore… and to be free or less inclined to  those feelings is just amazing!


Building a 16 tiles mosaic with FFMPEG

At work we recently (not that recently) we purchased a HDMI encoder. The product comes with 16 HDMI inputs and outputs everything to the network to be consumed via RTSP, RTMP, HLS and more. However the bloody device doesn’t bring any embedded solution to merge all the outputs into a single screen. You have to treat it separately. Crazy, right?!

So, the solution then was to find something that would build the mosaic of the 16 outputs. I looked quickly for a opensource tool that would do that for you, but didn’t find anything useful. Then, had to go to old friend linux and its gizmos.

FFMPEG, I knew would do the job, but as always it would take some tinkering and lots or reading…I had no choice but go with it.. and to my surprise was quicker, simpler and funnier than I thought.

Escrevendo em inglês – Porque?

Eu trabalho com TI, com informática, com computação. Deu pra entender né? Pra ser mais especifico, eu trabalho com segurança da informação e desenvolvimento para automação de tarefas. Isto significa, na prática que a literatura das coisas relacionadas do ramo, raramente são em português.

Por isto, já que eu leio em inglês, por que não escrever também? Por que eu não sou nativo? Porque talvez o número de erros gramaticais serão grandes? Talvez. Porém uma análise mais fria da coisa toda, me faz perceber que mesmo escrevendo em português eu não estaria livre deste risco. Na era das redes sociais, escrever errado se tornou o padrão da comunicação, por que as pessoas valorizam mais o “fazer-se entender” do que o propriamente escrever corretamente. Neste paradigma, escrever correto, na verdade aumento o risco do locutor não ser compreendido…( 🙂 ). Então por que não arriscar?

Assim, os posts relacionados a coisas técnicas e coisas de nerd deste blog serão em inglês. Os outros, posts, relacionados a corrida, bike e outras aventuras seguirão em português.