a php answer to https://www.spotify.com/uk/jobs/tech/reversed-binary/