.net convert

Can anyone convert this to visual cobol .net.  I am having trouble with the byte array.

 

using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())
{
      byte[] buff = new byte[Convert.ToInt16(saltsize)];
      rng.GetBytes(buff);
      return buff;
}

 

What i have thus far is

local-storage section.
01 buff type Byte[] occurs any.

perform using rng as type RNGCryptoServiceProvider = new RNGCryptoServiceProvider
       set buff to buff[type Convert::ToInt16(saltsize)]
end-perform

Tags:

  • To create an array of a certain size you can do:
    set size of your-array to the-size

    So in your example:
    local-storage section.
    01 buff type Byte[] occurs any.

    perform using rng as type RNGCryptoServiceProvider = new RNGCryptoServiceProvider
        set size of buff to type Convert::ToInt16(saltsize)
        invoke rng::GetBytes(buff)
    end-perform