Re: Restrict RAND to producing 63 random bits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 20, 2023 at 05:59:17PM -0400, Robert Moskowitz wrote:
> And the advantage of your approach is you can make a serialNumber longer 
> than 8 bytes.

No, because the shell doesn't do multi-precision arithmetic.  However,
a small tweak does the job.  For example, for 20 bytes:

    $ printf "%02x%s\n" $(( 0x$(openssl rand -hex 1) & 0x7f )) $(openssl rand -hex 19)
    0f8cf177eeab347c825a7ff7dfea6b1f2dd1df8c

-- 
    Viktor.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux