public void Provide(IBundleVersionProviderContext context)
        {
            byte[] hash;
            using (var sha256 = CryptographyAlgorithms.CreateSHA256())
                hash = sha256.ComputeHash(context.Content);

            context.Result = WebEncoders.Base64UrlEncode(hash);
        }
Exemplo n.º 2
0
        public void Provide(IBundleVersionProviderContext context)
        {
            var ticks = context.Timestamp.Ticks;

            var bytes = new byte[sizeof(long)];

            for (var i = 0; i < sizeof(long); i++)
            {
                bytes[i] = (byte)(ticks >> ((sizeof(long) - 1 - i) << 3) & 0xFF);
            }

            context.Result = WebEncoders.Base64UrlEncode(bytes);
        }
        public void Provide(IBundleVersionProviderContext context)
        {
            var ticks = context.Timestamp.Ticks;

#if NETSTANDARD2_0
            var bytes = new byte[sizeof(long)];
#else
            Span <byte> bytes = stackalloc byte[sizeof(long)];
#endif

            for (var i = 0; i < sizeof(long); i++)
            {
                bytes[i] = (byte)(ticks >> ((sizeof(long) - 1 - i) << 3) & 0xFF);
            }

            context.Result = WebEncoders.Base64UrlEncode(bytes);
        }
 public void Provide(IBundleVersionProviderContext context)
 {
 }