Anibal:
byte[] arr = [ 0x00, 0xA4, 0x04];This throws a int[] to byte[] cast error
You want ubytes (unsigned bytes) because 0x04 is 164 that is bigger than byte.max.
So use: ubyte[] arr = [ 0x00, 0xA4, 0x04];
I also tried byte[] arr = [cast(byte) 0x00, cast(byte)0xA4, cast(byte) 0x04]; and this at least compiles
Generally in D try to mimize as much as possible the usage of cast().
Bye, bearophile