Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127656 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id B3DAB1A00BC for ; Thu, 12 Jun 2025 16:50:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1749746928; bh=9kwyC05MxCu9EwTEMUtyGaJ2B4sYmIBlD2Y90cbtk48=; h=From:Date:Subject:To:From; b=ZPPbnIuYlBmI88ENxHaFaBBE/JaVB88o2G7S0TPMgRaFTQNt4BJODZSPsdyGFT9H3 Um190lV8O9cXqxwIuH6sjIfINnc3NUhZAA+Wbb3HnNADGWLENdSVJKv1R78l3OGc5r Nk7GbnxLJiMFYE6RMqDxfbKyXm/CiCuwJzy4THVXK6ItY8EkwCgccoBwW4uMCnzRUM 5shl/nO0uAQBT1HWWYZxhRzMG32JlDTei6Z2xlKp/Yn+FBlN9mH3la71H3fqgajVhd FBxHRLO7pL35giF+SM4pQE+JWqYBk9I+7KkzqPd8qTyOoEFZrujhVTUbMfr9WcMb9T m1xT4jWWGnjZQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5EE77180083 for ; Thu, 12 Jun 2025 16:48:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 12 Jun 2025 16:48:45 +0000 (UTC) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-23636167b30so12971325ad.1 for ; Thu, 12 Jun 2025 09:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749747044; x=1750351844; darn=lists.php.net; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=9kwyC05MxCu9EwTEMUtyGaJ2B4sYmIBlD2Y90cbtk48=; b=SWKjWZ+2nxoA1Aq8j+Y+N9ClUq2GdxIdmJ0z+0e9Gsa3wUrxbFJZ6XNojfEx729qJ3 Ydbr3iPDFO5K/dFTkQUG5xEdeRrIzD80VXVKXbPmbXu0TYe/Z3JACcKHY/bLSEc951VS cwbbibyidHHFVNzOI2G2OCU7Je1WAdm1d6D58KjtQfWhshlLf6g1wqm4m2I4qsjQzG4B WxQqP9TZXAMGbiZeCiKu+Baazg+ODqdjFFNEvEK6BSUMbiIpa2c/sASqHrbjiTDE47OP dvgS68TSt6ba9FlSPEfyI3HFmjUK6mfJMddzeLCD5nqPAzWkbD+eJkDmhYfQIqgYldXn 8sfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749747044; x=1750351844; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=9kwyC05MxCu9EwTEMUtyGaJ2B4sYmIBlD2Y90cbtk48=; b=WMN1gByRnC01hlhPcAUCTDIS3AAAt4DDnUA1V3vbDmGiQ+ddcG0Q5FDhJ21lT+JDYf 0csJ6G0tyuVZ/rOMYyK3+J6JKRkErki7lNYyAfi9Pn6ftX8H04WaMhBOQuT1R7HKna0A Dp1Yq4T2l2aa5rb6Sk7RRhuORQHbHFKO2qLJjg+SFnNgMb+BBZ1d9lMNr9GWf/j2jEzN Jof5S9oBanJekThWl8GN7gj+2gbpC/1HcqlTfpxCymmZZuqLU16TTJL7RYAG8u0ufyzg nEcmfGiA1V6O2scL3YMiEA1LJmiO2kgdsdqbP4BmozEshjRc8zoKD6hucOzipzb2eC0q eKkg== X-Gm-Message-State: AOJu0Yz+L1ZDFA/xCFy1GNB9L+mju4LfGKjDPUtlbDUQXzFvq6Tf7KWC 0pBMRpUffhdhhiErkSkoIuiUKNIwPwEGHdI+FXOSg68H0SaBF+dlDaroMVrJGwk9Cw5FuEyu629 84+cp2sq/gor4c8IkSD95NyfEnFOMvp4mgHdR X-Gm-Gg: ASbGncsIt6LPtRiRkaNE29/DFqPs9/0OEYbIEIvb/dgJzhFgVhzYgHza4b3RfAZelmW TMGAX0WEq3IDlaaXzcB4fopbw1ACi9lm2ueN3qBhT32AFoptAuzRgpi0EaO4hzSCUQmw/lzjDLV 66XOUpimA7X7v+PV8nzpEPZXE4FLyveZ5+1tH9FY8taKAy/5RnL/TvebrwJKkLZaIUtUxDqOqGi rFwSg/BQTTFAsGi X-Google-Smtp-Source: AGHT+IGqto563CeuNdjUyFMVozUc3wM/fWjkxpl8Ioh1iqkz3JAs3ZGEIajosMQcrvH91xBx6rS8lnHny0V0GGI47MI= X-Received: by 2002:a17:903:32c7:b0:234:c5c1:9b7a with SMTP id d9443c01a7336-2364c8b81dcmr54148755ad.8.1749747044090; Thu, 12 Jun 2025 09:50:44 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Thu, 12 Jun 2025 18:50:32 +0200 X-Gm-Features: AX0GCFubU4pyNWTmAMu8jCO_3f72qLgFjY1Vm6LheozcJOpmypWaT-IFJ4jTktQ Message-ID: Subject: [PHP-DEV] Proposal: Support for RFC4648 in PHP To: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000028a14063762bb8f" From: nyamsprod@gmail.com (ignace nyamagana butera) --000000000000028a14063762bb8f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Greetings, I have been playing around with an RFC proposal for some time and recently after discussing it with Tim D=C3=BCsterhus he has volunteered to do the implementation so I would like to submit to you an RFC around data encoding in PHP. The goal of the RFC is to fully implement RFC4648 (base16 , base32, base64). I know that PHP already has `base64_encode` and `base64_decode` and `bih2hex` and `hex2bin` but those functions only provide a partial support for RFC4648. In my RFC proposal I would like to introduce, instead, a new namespace `Encoding` that will host an all new and improved API which will cover the complete RFC, will be consistent and easily extendable for future data encoding algorithms addition. For reference, this is not a new topic, the issue with the current implementation is well documented in the mailing list as well as a past attempt to add RFC4648 to the language. - base64_encode without padding https://externals.io/message/122630 - base64 url format https://externals.io/message/119243 - [RFC] RFC4648 encoding https://externals.io/message/91858#91964 If people are interested I will proceed with a karma request and create the draft RFC. Best regards, Ignace Nyamagana Butera --000000000000028a14063762bb8f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Greetings,

I have been playing around with an RFC p= roposal for some time and recently after discussing it with Tim D=C3=BCster= hus he has volunteered
to do the implementation so I would like to submi= t to you an RFC around data encoding in PHP. The goal of the RFC is to full= y implement
RFC4648 (base16 , base32, base64).

I know that PHP a= lready has `base64_encode` and `base64_decode` and `bih2hex` and `hex2bin` = but those functions only provide a partial support for RFC4648.
In my R= FC proposal I would like to=C2=A0introduce, instead, a new namespace `Encod= ing` that will host an all new and improved API which=C2=A0will cover the c= omplete RFC,
will be consistent and easily extendable for future = data encoding algorithms addition.

For reference, this i= s not a new topic, the issue with the current implementation is well docume= nted in the mailing list as well as a past attempt to
add RFC4648 to th= e language.

- base64_encode without padding https://externals.io/message/122630
- base6= 4 url format https://extern= als.io/message/119243
- [RFC] RFC4648 encoding https://externals.io/message/91858#91964

If people are interested I will proceed with a karma request and c= reate the draft RFC.

Ignace Nyamagana Butera
--000000000000028a14063762bb8f--