小编Bri*_*oss的帖子

将VB转换为C#

我有一个用VB编写的加密类,我试图将其转换为C#.在VB代码中,有一段代码:

    ' Allocate byte array to hold our salt.
    Dim salt() As Byte = New Byte(saltLen - 1) {}

    ' Populate salt with cryptographically strong bytes.
    Dim rng As RNGCryptoServiceProvider = New RNGCryptoServiceProvider()

    rng.GetNonZeroBytes(salt)

    ' Split salt length (always one byte) into four two-bit pieces and
    ' store these pieces in the first four bytes of the salt array.
    salt(0) = ((salt(0) And &HFC) Or (saltLen And &H3))
    salt(1) = ((salt(1) And &HF3) Or (saltLen And &HC))
    salt(2) = ((salt(2) …
Run Code Online (Sandbox Code Playgroud)

c# vb.net code-translation

1
推荐指数
1
解决办法
312
查看次数

标签 统计

c# ×1

code-translation ×1

vb.net ×1