mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-06 13:57:54 +00:00
Move hid generation to the database. Closes #157.
This commit is contained in:
parent
c39c51426f
commit
8ac2f1e4b8
5 changed files with 36 additions and 43 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue