Has anyone done any unsigned int32 to signed int32...
# cfml-general
s
Has anyone done any unsigned int32 to signed int32 conversion in CF? Actually more accurately, unsigned long (int64) to signed int32 conversion. My problem is, I need the results of a java crc16 calculation stored in a MSSQL int column:
Copy code
var checksum = createObject( "java", "java.util.zip.CRC32" ).init();
        checksum.update( charsetDecode( input, "utf-8" ) );
        var crc = javaCast("int",checksum.getValue());
crc I need inserted into a sql table:
Copy code
...
crc:         { value:"#crc#", cfsqltype:"integer" },
...
The problem is, checksum.getValue() returns a long int (signed) because java does not support unsigned int32. But my google expertise is failing me here and I cannot find a simple solution.