[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3954380.1764102837@warthog.procyon.org.uk>
Date: Tue, 25 Nov 2025 20:33:57 +0000
From: David Howells <dhowells@...hat.com>
To: James Bottomley <James.Bottomley@...senPartnership.com>
Cc: dhowells@...hat.com, linux-kernel <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Blaise Boscaccy <bboscaccy@...ux.microsoft.com>
Subject: Re: [PATCH] oid_registry: allow arbitrary size OIDs
James Bottomley <James.Bottomley@...senPartnership.com> wrote:
> This isn't usually a problem
> except that it prevents us from representing the 2.25. prefix OIDs
> which are the OID representation of UUIDs and have a 128 bit number
> following the prefix.
Ewww.
> Rather than import not often used perl arithmetic modules,
Do they not work? Or are they just not commonly installed?
> + # Base128 encode the number
> + my $j;
> + my $b;
> + for ($j = 0; $j < $tmp; $j++) {
I would do:
for (my $j = 0; $j < $tmp; $j++) {
> + $b = oct("0b".substr($c, $j * 7, 7));
I would probably do "my $b = ..." here.
> +
> + push @octets, $b | 0x80;
> }
> - push @octets, $c & 0x7f;
> + $b = oct("0b".substr($c, $j * 7, 7));
> + push @octets, $b;
and just combine these two lines:
push @octets, oct("0b".substr($c, $j * 7, 7));
Using "oct("0b"...)" looks weird, but I guess it should work.
David
Powered by blists - more mailing lists