licenseToDeviceId static method

int? licenseToDeviceId(
  1. String licenseToken
)

Implementation

static int? licenseToDeviceId(String licenseToken) {
  try {
    List<String> license = licenseToken.split(":")[1].split(".");
    int deviceId = int.parse(
        hex.encoder.convert(base64.decode(license[1].padRight(4, "="))),
        radix: 16);
    return deviceId;
  } catch (e) {
    return null;
  }
}