integer based bit shifting, more convenient than ByteString for now