toCodec static method

double toCodec(
  1. String codec
)

Implementation

static double toCodec(String codec) {
  final codes = ascii.encode(codec);
  if (codes.length != 4) return -1;
  final c1 = codes[0];
  final c2 = codes[1];
  final c3 = codes[2];
  final c4 = codes[3];
  return ((c1 & 255) + ((c2 & 255) << 8) + ((c3 & 255) << 16) + ((c4 & 255) << 24)).toDouble();
}