From 182235c4cd1a5e73807cfba097efe6ddb2256690 Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Wed, 18 Dec 2024 07:14:04 +0300 Subject: [PATCH] feat: add generator base32 for totp --- Security/Services/GeneratorKey.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Security/Services/GeneratorKey.cs b/Security/Services/GeneratorKey.cs index b71bfab..80a5b8e 100644 --- a/Security/Services/GeneratorKey.cs +++ b/Security/Services/GeneratorKey.cs @@ -25,6 +25,10 @@ public static class GeneratorKey .ToArray()); } + public static string GenerateAlphaNumericBase32Compatible(int size, string? excludes = null, + string? includes = null) => + GenerateAlphaNumeric(size, excludes + "0189", includes); + public static ReadOnlySpan GenerateBytes(int size) { var key = new byte[size];