Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127657 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 8286E1A00BC for ; Thu, 12 Jun 2025 17:23:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1749748886; bh=wQd/az0ONXAV9x7y4PIBDEIgye2XGDe5n6fq1PUkOGw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=fmS226B1cinnasZInLuK3OVRmcTIV1irPA1WD/zfjyKQUn2qzhSXJlq3gWMpN7UzL gvSVlnrCjBxp/zkAgaS755sAcR50L6ms5zRYmjBJPOlqF650MXMTjgxgA5c9XJUl1C Fl7Ua/9Qpf/79KmaFP+IPP8SYBJ5r4ewazZrGvoalxPIW5UGmMQGDeM37q4PxsXBlD qsN2fxBNFJJcRrEHHD9vEDWXRoR6lKYBq47xD786GsIJDI/3I10pEbZt7xmca57407 Xu5XlW70gC8g+hPP5MBYhFY3mjTMLNKYmsgH3dFf9xrY+4WSw47pJWB5FvFJKN0tqi jC1Z9ZkiH8IhQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DC54718004C for ; Thu, 12 Jun 2025 17:21:25 +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.8 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,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-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (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 17:21:22 +0000 (UTC) Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-7fd35b301bdso1330245a12.2 for ; Thu, 12 Jun 2025 10:23:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749749002; x=1750353802; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wQd/az0ONXAV9x7y4PIBDEIgye2XGDe5n6fq1PUkOGw=; b=XfpgbMOScnJ7l+jjpMi5K7j7jPjhh5eiZ9HBAOoewHFOBxOtVKe63wJC1HjtViEDLr 4p5NhQIre/FFJi3utnpMQqzxmlyElnCKLmCJmK0uWkSxpbjQ+BSiwfLd50kpR3Yn1qFc i4nCi+HogMiFh98iHt8Fy7sWuHKRTEyxPHzyEbRzLX4X/Xu2sYTwEkDICXhRpeesVElS UAl7bi+GWjudmcc6M29D/R9zvYKPFDWcYFYGJMcyA2WOjf1Jcrqc58/j3YKWUqS5WPsZ 9w7LRdhbLatmgUv0mx8HLeYefz7nUV7oiSrgoP3FDxdhTQ36Uv2vtQXgcjTwxj4WCl5v TgSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749749002; x=1750353802; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wQd/az0ONXAV9x7y4PIBDEIgye2XGDe5n6fq1PUkOGw=; b=j5upbHuA9E78vL0c0f2mo1KMraMcAWMGXxNbiQ+oJzLCtBx8WTqqnAPLju4Agx6E8Z i1UBGdfzbTQE6M4MtQmiO96F36XFXLiGo//XnWkUM+5KeulOqsaSSCieem/DpoRMuM0S Z6Bj4HnC5wX2UN7TeJsPli4ehIN/HaSxJCa0n3dtuHuvql/j/lgJ2j7AwHCCtvldV45i mEjCCctnSuoai4CmDi9ZY0ygD7v2hgGXRFIw8il2UpU5ctcJx70gqHQE0biC377sMG1n NOJTn2SdZ4/0kJzoVSaIsyaoX34ZFmribHjgKokR4pM3gBaRw0OnUThlxPySxgtY1H6r 9Nxw== X-Gm-Message-State: AOJu0YylC43YCjPJh8XdqcrpDsaKmkZIK+fBwLbJffvG2DCD2pe7X+Bp 2RW2r7zqtYZ9HzkdT0yOk3m+LG6lNKeAxAvWNSnxMSmzpGu/ETSU7mkl/J4qO2RzoLjBH7tUBUZ F2cC6tAd8vhV5BP0IWYaTf5oIt9702ieijqSo X-Gm-Gg: ASbGncvam8c3//AwbI6dJAUVEVx1AGMlCj4P3lqmHza3Ty8dNBhUf/TYGdXZLFckks9 DDqI9x94g2za3yimARKYIWlzLBH9DSa4St6vI1d7sXKY0SC6sEPYfml1PrSRU1cwD11EikuCIXJ S3znMuMBmfh+3xkn0kFlDxDWWn2CRHNyA22vthXuIwzNhG X-Google-Smtp-Source: AGHT+IHLsKh1NnUF1BfAlt6gZyIzoMeKBLVsujAhL4X4QffvZD1l4Vn2R69gBTVBh6mD0eeNzlAYE44X6oOmAOAS9MU= X-Received: by 2002:a17:90b:3c4b:b0:312:e279:9ccf with SMTP id 98e67ed59e1d1-313d9bd4a80mr29034a91.5.1749749001899; Thu, 12 Jun 2025 10:23:21 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 12 Jun 2025 19:22:46 +0200 X-Gm-Features: AX0GCFt9xHhwV3QI1HmINkarS9E4HyAvazgu7pqJ60ty1grcbYljkcin9-cIBEs Message-ID: Subject: Re: [PHP-DEV] Proposal: Support for RFC4648 in PHP To: ignace nyamagana butera Cc: PHP Internals List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: divinity76@gmail.com (Hans Henrik Bergan) On Thu, 12 Jun 2025 at 18:53, ignace nyamagana butera wrote: > > Greetings, > > I have been playing around with an RFC proposal for some time and recentl= y 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 d= ata 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 `bih2= hex` and `hex2bin` but those functions only provide a partial support for R= FC4648. > In my RFC proposal I would like to introduce, instead, a new namespace `E= ncoding` that will host an all new and improved API which will cover the co= mplete RFC, > will be consistent and easily extendable for future data encoding algorit= hms addition. > > For reference, this is not a new topic, the issue with the current implem= entation is well documented in the mailing list as well as a past attempt t= o > 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 t= he draft RFC. > > Best regards, > Ignace Nyamagana Butera Why do it in core? Is userland base16/base32 performance unsatisfactory?