Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
test code
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Text; using System.Security.Cryptography; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine("Hello, world!"); Console.WriteLine(HMACSHA1("T3yIrL7e10aqTmEJN7bOlqj/ml9cdKFN","QPRVnJAo1kg=")); } public static string HMACSHA1 (string key, string dataToSign) { Byte[] secretBytes = UTF8Encoding.UTF8.GetBytes(key); Console.WriteLine("secretBytes "+secretBytes.Length); for (int i=0; i<secretBytes.Length;i++){ Console.WriteLine("secretBytes: "+i+" value: "+secretBytes[i]); } HMACSHA1 hmac = new HMACSHA1(secretBytes); Byte[] dataBytes = UTF8Encoding.UTF8.GetBytes(dataToSign); Byte[] calcHash = hmac.ComputeHash(dataBytes); Console.WriteLine(""); Console.WriteLine("Computed Hash"); for (int i=0; i<calcHash.Length;i++){ Console.WriteLine("calcHash: "+i+" value: "+calcHash[i]); } String calcHashString = Convert.ToBase64String(calcHash); return calcHashString; } } }
run
|
edit
|
history
|
help
0
IsStringAPalindrome
ok
Palindrome Number
Main 5.6
JavaScript
Reed Solomon Demo
SortRank
amstrong number
JagArray
Find the sum of squares for prime numbers of the form (4k + 1).