91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 9.67KB
    文件類型: .zip
    金幣: 1
    下載: 0 次
    發布日期: 2024-05-03
  • 語言: C#
  • 標簽: google??go??

資源簡介

C#使用 谷歌身份認證器,動態口令,GoogleAuthenticator 基于時間的一次性密碼

資源截圖

代碼片段和文件信息

using?System;
namespace?GoogleAuthorization
{
????public?static?class?base32
????{
????????public?static?byte[]?ToBytes(string?input)
????????{
????????????if?(string.IsNullOrEmpty(input))
????????????{
????????????????throw?new?ArgumentNullException(“input“);
????????????}

????????????input?=?input.TrimEnd(‘=‘);?
????????????int?byteCount?=?input.Length?*?5?/?8;?
????????????byte[]?returnArray?=?new?byte[byteCount];

????????????byte?curByte?=?0?bitsRemaining?=?8;
????????????int?mask?=?0?arrayIndex?=?0;

????????????foreach?(char?c?in?input)
????????????{
????????????????int?cValue?=?CharToValue(c);

????????????????if?(bitsRemaining?>?5)
????????????????{
????????????????????mask?=?cValue?<????????????????????curByte?=?(byte)(curByte?|?mask);
????????????????????bitsRemaining?-=?5;
????????????????}
????????????????else
????????????????{
????????????????????mask?=?cValue?>>?(5?-?bitsRemaining);
????????????????????curByte?=?(byte)(curByte?|?mask);
????????????????????returnArray[arrayIndex++]?=?curByte;
????????????????????curByte?=?(byte)(cValue?<????????????????????bitsRemaining?+=?3;
????????????????}
????????????}

????????????if?(arrayIndex?!=?byteCount)
????????????{
????????????????returnArray[arrayIndex]?=?curByte;
????????????}

????????????return?returnArray;
????????}

????????public?static?string?ToString(byte[]?input)
????????{
????????????if?(input?==?null?||?input.Length?==?0)
????????????{
????????????????throw?new?ArgumentNullException(“input“);
????????????}

????????????int?charCount?=?(int)Math.Ceiling(input.Length?/?5d)?*?8;
????????????char[]?returnArray?=?new?char[charCount];

????????????byte?nextChar?=?0?bitsRemaining?=?5;
????????????int?arrayIndex?=?0;

????????????foreach?(byte?b?in?input)
????????????{
????????????????nextChar?=?(byte)(nextChar?|?(b?>>?(8?-?bitsRemaining)));
????????????????returnArray[arrayIndex++]?=?ValueToChar(nextChar);

????????????????if?(bitsRemaining?????????????????{
????????????????????nextChar?=?(byte)((b?>>?(3?-?bitsRemaining))?&?31);
????????????????????returnArray[arrayIndex++]?=?ValueToChar(nextChar);
????????????????????bitsRemaining?+=?5;
????????????????}

????????????????bitsRemaining?-=?3;
????????????????nextChar?=?(byte)((b?<????????????}

????????????if?(arrayIndex?!=?charCount)
????????????{
????????????????returnArray[arrayIndex++]?=?ValueToChar(nextChar);
????????????????while?(arrayIndex?!=?charCount)?returnArray[arrayIndex++]?=?‘=‘;?
????????????}

????????????return?new?string(returnArray);
????????}

????????private?static?int?CharToValue(char?c)
????????{
????????????var?value?=?(int)c;

????????????if?(value??64)
????????????{
????????????????return?value?-?65;
????????????}
????????????if?(value??49)
????????????{
????????????????return?value?-?24;
????????????}
????????????if?(value??96)
????????????{
????????????????return?value?-?97;
?????

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-11-13?01:22??GoogleAuthenticator-master\
?????文件????????5850??2019-11-13?01:22??GoogleAuthenticator-master\.gitignore
?????文件????????1004??2019-11-13?01:22??GoogleAuthenticator-master\GoogleAuthenticator.sln
?????目錄???????????0??2019-11-13?01:22??GoogleAuthenticator-master\GoogleAuthorization\
?????文件????????3453??2019-11-13?01:22??GoogleAuthenticator-master\GoogleAuthorization\base32.cs
?????文件????????3420??2019-11-13?01:22??GoogleAuthenticator-master\GoogleAuthorization\GoogleAuthenticator.cs
?????文件????????2545??2019-11-13?01:22??GoogleAuthenticator-master\GoogleAuthorization\GoogleAuthenticator.csproj
?????文件?????????873??2019-11-13?01:22??GoogleAuthenticator-master\GoogleAuthorization\Program.cs
?????目錄???????????0??2019-11-13?01:22??GoogleAuthenticator-master\GoogleAuthorization\Properties\
?????文件????????1326??2019-11-13?01:22??GoogleAuthenticator-master\GoogleAuthorization\Properties\AssemblyInfo.cs
?????文件????????1028??2019-11-13?01:22??GoogleAuthenticator-master\README.md

評論

共有 條評論