< Summary

Class:Azure.Security.KeyVault.Base64Url
Assembly:Azure.Security.KeyVault.Secrets
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Shared\src\Base64Url.cs
Covered lines:3
Uncovered lines:0
Coverable lines:3
Total lines:24
Line coverage:100% (3 of 3)
Covered branches:1
Total branches:2
Branch coverage:50% (1 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
Decode(...)-100%50%
Encode(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Shared\src\Base64Url.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Text;
 6
 7namespace Azure.Security.KeyVault
 8{
 9    internal static class Base64Url
 10    {
 11        public static byte[] Decode(string str)
 12        {
 413            str = new StringBuilder(str).Replace('-', '+').Replace('_', '/').Append('=', (str.Length % 4 == 0) ? 0 : 4 -
 14
 415            return Convert.FromBase64String(str);
 16        }
 17
 18        public static string Encode(byte[] bytes)
 19        {
 420            return new StringBuilder(Convert.ToBase64String(bytes)).Replace('+', '-').Replace('/', '_').Replace("=", "")
 21        }
 22
 23    }
 24}

Methods/Properties

Decode(...)
Encode(...)