BitConverter for javascript