mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
17 lines
429 B
C#
17 lines
429 B
C#
using System.Security.Cryptography;
|
|
using System;
|
|
|
|
namespace Remotely.Shared.Utilities
|
|
{
|
|
public static class PasswordGenerator
|
|
{
|
|
public static string GeneratePassword(int size)
|
|
{
|
|
var buffer = new byte[size];
|
|
var rng = RandomNumberGenerator.Create();
|
|
rng.GetNonZeroBytes(buffer);
|
|
return Convert.ToBase64String(buffer).Replace("=", "");
|
|
}
|
|
}
|
|
}
|