Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Guid Combined
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.IO; using System.Threading; using System.Threading.Tasks; namespace Rextester { public static class SystemExtensions { public static byte[] Combine(this byte[] @this, params byte[][] arrays) { byte[] rv = new byte[arrays.Sum(a => a.Length) + @this.Length]; int offset = 0; Buffer.BlockCopy(@this, 0, rv, offset, @this.Length); offset += @this.Length; foreach (byte[] array in arrays) { Buffer.BlockCopy(array, 0, rv, offset, array.Length); offset += array.Length; } return rv; } } public class Program { public static void Main(string[] args) { Parallel.For(0, 50, i => { var guidM = Guid.NewGuid().ToString("N").Substring(0, 10); Console.WriteLine(guidM); }); Parallel.For(0, 50, i => { var guidM = Guid.NewGuid(); var guidCombined = Convert.ToBase64String(Guid.NewGuid().ToByteArray().Combine(guidM.ToByteArray())).Substring(0, 10); Console.WriteLine(guidCombined); }); } } }
run
|
edit
|
history
|
help
0
codeWall
Const
Captcha
lasses, properties, methods, ling begining
Hello world
Programa_01_01_Declaracion_de_clases
pyramidalt
Palindrome
asxasxdf
Lottofacil