For a couple of years I had an on and off discussion with some of my peers on hashing passwords on the client as well as the server.
Continue reading "On Hashing Passwords Clientside"Month: February 2025
Studio Producing
It has always been a passion of mine to record, mix and master music. I am by no means a professional, but I tought I'd like to share my knowledge so far.
Continue reading "Studio Producing"A weird uint16_t and uint8_t fact
Consider the following C/C++ code
#include <stdint.h>
int test_this() {
return (uint16_t) 1 >= (int16_t) -1;
}
And now this code
#include <stdint.h>
int test_this() {
return (uint32_t) 1 >= (int32_t) -1;
}
The only difference is the uint32_t and int32_t.
Assembly code
The 16 bit variant generates the following assembly code
test_this():
push rbp
mov rbp, rsp
mov eax, 1
pop rbp
ret
The 32 bit variant generates the following assembly code
test_this():
push rbp
mov rbp, rsp
mov eax, 0
pop rbp
ret
As you can see, we have a different outcome based on whether we used 16 or 32 bit.
Mind, all of the code is compiled using clang/gcc/msvc -O0 in the most recent version on x86/arm/aarch etc.
You can try it on godbolt.org.
A possible solution
In the 16 bit variant both of the comparison instructions are promoted to 32 bit signed integers and thats why it returns 1.
On the 32 bit variant the signed type is reinterpreted as an unsigned integer, thus being larger in value.
HTTP
This is a work in progess document about things I consider interesting about http(s).
Continue reading "HTTP"My favorite git commands
This collection mainly serves me as a reminder what cool git commands exist.
Continue reading "My favorite git commands"No. 3: Milan
In a foggy early morning hour, the trip continued further. I got a little stressed over the fact that our initial booking for a room in a deeply Italian business in a small suburb 30 minutes from the city of Milan got cancelled. So I had to organize somewhere to sleep in a matter of hours or otherwise we wouldn't be able to sleep that night.
Continue reading "No. 3: Milan"