コード例 #1
0
ファイル: salt.cs プロジェクト: linbozhang/ThrowCoin
    // --- create salt ----
    private byte[] generateSalt()
    {
        PseudoRandom mRandom = PseudoRandom.getInstance();

        byte[] content = mRandom.generateRandom(SALT_LENGTH);
        // Create the file and write to it.
        // DANGER: System.IO.File.Create will overwrite the file if it already exists.
        using (FileStream fs = File.Create(saltPath)) {
            fs.Write(content, 0, content.Length);
        }
        return(content);
    }