Answers for "baze64 length"

0

baze64 length

public int GetOriginalLengthInBytes(string base64string)
{
    if (string.IsNullOrEmpty(base64string)) { return 0; }

    var characterCount = base64string.Length;
    var paddingCount = base64string.Substring(characterCount - 2, 2)
                                   .Count(c => c == '=');
    return (3 * (characterCount / 4)) - paddingCount;
}
Posted by: Guest on August-30-2021

Browse Popular Code Answers by Language