I have this function is Node.js
// @param {BigInteger} checksum
// @returns {Uint8Array}
function checksumToUintArray(checksum) {
var result = new Uint8Array(8);
for (var i = 0; i < 8; ++i) {
result[7 - i] = checksum.and(31).toJSNumber();
checksum = checksum.shiftRight(5);
}
return result;
}
What would be the equivalent in c#?
I'm thinking:
public static uint[] ChecksumToUintArray(long checksum)
{
var result = new uint[8];
for (var i = 0; i < 8; ++i)
{
result[7 - i] = (uint)(checksum & 31);
checksum = checksum >> 5;
}
return result;
}
But I'm no sure. My main dilemma is the "BigInteger" type (but not only). Any help would be appropriated.
uint[]or rename the method.