using System;
using System.Security.Cryptography;
namespace HH.WCS.Mobox3.RiDong.util;
internal class StrHelper
{
///
/// 获取随机字符串
///
///
///
///
public static string StrRandom(string prefix, int Length)
{
byte[] b = new byte[32];
RandomNumberGenerator.Create().GetBytes(b);
Random random = new Random(BitConverter.ToInt32(b, 0));
string str = "0123456789"; //abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
string returnStr = string.Empty;
for (int i = 0; i < Length; i++)
{
returnStr += str.Substring(random.Next(0, str.Length - 1), 1);
}
var cntrCode = prefix + returnStr;
return cntrCode;
}
}