Move hid generation to the database. Closes #157.

This commit is contained in:
Ske
2020-06-13 00:43:48 +02:00
parent c39c51426f
commit 8ac2f1e4b8
5 changed files with 36 additions and 43 deletions

View File

@@ -6,18 +6,6 @@ namespace PluralKit.Core
{
public static class StringUtils
{
public static string GenerateHid()
{
var rnd = new Random();
var charset = "abcdefghijklmnopqrstuvwxyz";
string hid = "";
for (int i = 0; i < 5; i++)
{
hid += charset[rnd.Next(charset.Length)];
}
return hid;
}
public static string GenerateToken()
{
var buf = new byte[48]; // Results in a 64-byte Base64 string (no padding)