On 12/25/2014 01:46 AM, enh wrote:
> On Wed, Dec 24, 2014 at 7:47 PM, Rob Landley <[email protected]> wrote:
>> On 12/12/14 17:19, Robert Thompson wrote:
>>> I ran across a variance between toybox factor and coreutils factor.
...
>> As you mentioned, you added a curly bracket level without indenting the code.
>> I could do a tail call and expect the compiler to turn the recursion into
>> iteration, but reindenting the code properly is worth the noise in the diff.
>>
>> The version I checked in won't error out for 'factor ""' or 'factor "36 "'
>> the way Ubuntu's will, but I think I'm ok with that...?
> 
> out of curiosity, what practical use is there for factor? even the
> coreutils version gives up around 38 decimal digits, and it's pretty
> slow even with numbers that small.

I was reading http://www.muppetlabs.com/~breadbox/txt/rsa.html#14 on a
long bus ride, because I probably have to implement TLS someday (by
which I mean https not thread local storage) because wget can't talk to
the world without encryption anymore (thanks NSA), and the section I
linked to above used "factor", and I went "that's a command? Apparently
so. This is probably like a dozen lines to implement"... and had it
working before the end of the bus ride.

So the answer is "you use it when writing tutorials about cryptographic
implementation details".

Really I just needed a break from reading mind-bending math stuff so I
implemented a small self-contained thing for fun, and then checked it in
because it came preinstalled in ubuntu and was tiny. I wouldn't have
bothered if you couldn't switch it off in the config when optimizing for
size.

I was surprised as anybody else to get a patch for it, but that means
it's apparently useful to somebody. By all means, switch it off in
Android. :)

Rob

P.S. At a design level I thought about defaulting it "n" but the
defconfig y/n signalling primarily indicates "is this done or not" and
it was finished and worked fine, so... (Well, the examples directory
also has stuff that defaults to "n" but factor isn't really a
demonstration of how to use the toybox infrastructure either.) And
defaulting "n" for other reasons is editorializing, where does it stop?
rev and tac? fallocate? makedevs? freeramdisk? partprobe? People _asked_
me to add most of those, because they needed them. If somebody want to
make a .config file selecting a subset of the commands, you can do that.
It's not my job to guess how people will use generic tools.
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to