DataType for storing a long serial number (10 bytes)
Posted
by CrimsonX
on Stack Overflow
See other posts from Stack Overflow
or by CrimsonX
Published on 2010-06-03T15:36:17Z
Indexed on
2010/06/03
15:54 UTC
Read the original article
Hit count: 287
We have a device which has a 10 byte serial number which must be read into our application and stored into a .net datatype. In the device it is stored as an unsigned 10-byte (80-bit) number. I don't expect we will be performing any mathematical operations on this number, but only displaying it to the user.
The .NET framework doesn't have a built in UNIT128 to store this datatype. My suggestion for storing this datatype is to create a 10 element byte array and read in the data into this array. Are there any better solutions to this problem?
Note: I have seen in this question that a GUID is a 128 byte signed integer, but it seems like a bad idea to use a GUID in this fashion. Any other suggestions?
© Stack Overflow or respective owner