From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: outlook.de, ip: 40.92.68.73, mailfrom: mhaeuser@outlook.de) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (EUR02-HE1-obe.outbound.protection.outlook.com [40.92.68.73]) by groups.io with SMTP; Mon, 15 Jul 2019 11:44:12 -0700 Received: from VE1EUR02FT018.eop-EUR02.prod.protection.outlook.com (10.152.12.56) by VE1EUR02HT129.eop-EUR02.prod.protection.outlook.com (10.152.13.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.19; Mon, 15 Jul 2019 18:44:08 +0000 Received: from AM5PR0701MB2834.eurprd07.prod.outlook.com (10.152.12.57) by VE1EUR02FT018.mail.protection.outlook.com (10.152.12.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.19 via Frontend Transport; Mon, 15 Jul 2019 18:44:08 +0000 Received: from AM5PR0701MB2834.eurprd07.prod.outlook.com ([fe80::5585:5a3d:8f1d:9c62]) by AM5PR0701MB2834.eurprd07.prod.outlook.com ([fe80::5585:5a3d:8f1d:9c62%5]) with mapi id 15.20.2094.009; Mon, 15 Jul 2019 18:44:08 +0000 From: mhaeuser@outlook.de To: "devel@edk2.groups.io" , "lersek@redhat.com" CC: Liming Gao , Michael D Kinney , =?utf-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= , Zhichao Gao Subject: Re: [edk2-devel] [PATCH 2/3] MdePkg/BaseLib: rewrite Base64Decode() Thread-Topic: [edk2-devel] [PATCH 2/3] MdePkg/BaseLib: rewrite Base64Decode() Thread-Index: AQHVMMD7YReojoSe4kiu662Ro4fUu6bMEuAQ Date: Mon, 15 Jul 2019 18:44:07 +0000 Message-ID: References: <20190702102836.27589-1-lersek@redhat.com> <20190702102836.27589-3-lersek@redhat.com> In-Reply-To: <20190702102836.27589-3-lersek@redhat.com> Accept-Language: de-DE, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:A42AE27E28A10AFE2408A15FF11A7013FFC75C04D1CAE6560DC348FFBD7EC234;UpperCasedChecksum:64A6089262A91CDE9A2E979B4EC5ECAD702AE33A6889F7F9E463B02B7B758621;SizeAsReceived:7012;Count:43 x-tmn: [VBADnMShxMC7GDDSzPY2fiVN9/v/h+gU] x-ms-publictraffictype: Email x-incomingheadercount: 43 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(5050001)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031322404)(2017031323274)(2017031324274)(1601125500)(1603101475)(1701031045);SRVR:VE1EUR02HT129; x-ms-traffictypediagnostic: VE1EUR02HT129: x-ms-exchange-purlcount: 5 x-microsoft-antispam-message-info: rRU3f+w4PUkrxFZPnARcyud765pH7b8tDVzIPtOlgtHFXGvfTJhuEMBXNVW5sdcpFDaF7+qL06Px+UtwinpdsBWAUcr1quD7ZkJ4ayly9GFE5KhLv6ZdbtfSWF8V9PhCcrgDon3b7SfE+oRwmEdXMyQ/ZqzaMJ42cQGDnVhTnP3mrkcWe0+61KGAT9J2Pi+f MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 377752b4-dbbe-4f4b-0ea7-08d709546b7f X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jul 2019 18:44:08.0476 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR02HT129 Content-Language: de-D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