A Bit Overcomplicated
At the risk of sounding stupid, I have no idea how bit-shifting and bitwise operators work, though I&#x27;ve worked in the field for over a decade and am now a Staff Engineer or whatever. There, I said it.<p>It&#x27;s just something I haven&#x27;t gotten around to reading yet. I suspect some code would be made clearer by it, but even when doing something similar I wound up using the math textbook was to do it even though I suspect the bit operators would be much faster.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;sudhirj&#x2F;shortuuid.rb&#x2F;blob&#x2F;master&#x2F;lib&#x2F;shortuuid.rb#L14" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sudhirj&#x2F;shortuuid.rb&#x2F;blob&#x2F;master&#x2F;lib&#x2F;shor...</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;sudhirj&#x2F;shortuuid.go&#x2F;blob&#x2F;master&#x2F;shortuuid.go#L14" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sudhirj&#x2F;shortuuid.go&#x2F;blob&#x2F;master&#x2F;shortuui...</a>