File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/FileSizeFromBase64.NET Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -14,14 +14,14 @@ public static class FileSizeHelpers
1414 /// <param name="applyPaddingsRules">Indicate if the padding management is required or not. Default is false</param>
1515 /// <param name="unitsOfMeasurement">The unit of measure of the file size returned by the method. The default unit of measure is Byte.</param>
1616 /// <returns>The size of the file represented by the base64 string.</returns>
17- public static double GetFileSizeFromBase64String ( string base64String , Boolean applyPaddingsRules = false , UnitsOfMeasurement unitsOfMeasurement = UnitsOfMeasurement . Byte )
17+ public static double GetFileSizeFromBase64String ( string base64String , bool applyPaddingsRules = false , UnitsOfMeasurement unitsOfMeasurement = UnitsOfMeasurement . Byte )
1818 {
1919 if ( string . IsNullOrEmpty ( base64String ) ) return 0 ;
2020
21- // Remove MIME-type from the base64 if exists
21+ // Remove MIME-type from the base64 string if exists and get the string length
2222 var base64Length = base64String . Contains ( "base64," ) ? base64String . Split ( ',' ) [ 1 ] . Length : base64String . Length ;
2323
24- var fileSizeInByte = Math . Ceiling ( ( double ) base64Length / 4 ) * 3 ;
24+ var fileSizeInByte = Math . Ceiling ( ( double ) base64Length / 4 ) * 3 ;
2525
2626 if ( applyPaddingsRules && base64Length >= 2 )
2727 {
@@ -49,6 +49,6 @@ public enum UnitsOfMeasurement
4949 /// <summary>
5050 /// MB.
5151 /// </summary>
52- MegaByte = 1_048_576 ,
52+ MegaByte = 1_048_576
5353 }
5454}
You can’t perform that action at this time.
0 commit comments