2
0
Эх сурвалжийг харах

bugfix in complement, was not padding the good amount of = signs

Nicolas Cannasse 11 жил өмнө
parent
commit
8cd3196015

+ 1 - 1
std/haxe/crypto/Base64.hx

@@ -32,7 +32,7 @@ class Base64 {
 	public static function encode( bytes : haxe.io.Bytes, complement = true ) : String {
 		var str = new BaseCode(BYTES).encodeBytes(bytes).toString();
 		if( complement )
-			for( i in 0...(bytes.length*4)%3 )
+			for( i in 0...(3-(bytes.length*4)%3)%3 )
 				str += "=";
 		return str;
 	}