This commit is contained in:
20
util/ShortId.cs
Normal file
20
util/ShortId.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
|
||||
namespace GZTW.Pecklist.Util
|
||||
{
|
||||
//Authentication controller
|
||||
public static class ShortId
|
||||
{
|
||||
|
||||
/////////////////////////////////
|
||||
// Generate a random shortId
|
||||
//
|
||||
// Based off this: https://stackoverflow.com/a/9279005/8939
|
||||
public static string Generate()
|
||||
{
|
||||
return Convert.ToBase64String(Guid.NewGuid().ToByteArray()).Replace("=","").Replace("/","").Replace("+","");
|
||||
}
|
||||
|
||||
}//eoc
|
||||
|
||||
}//eons
|
||||
Reference in New Issue
Block a user