• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tecnickcom / nurago / 29266131380
100%

Build:
DEFAULT BRANCH: main
Ran 13 Jul 2026 04:26PM UTC
Jobs 1
Files 191
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Jul 2026 04:22PM UTC coverage: 100.0%. Remained the same
29266131380

push

github

nicolaasuni
fix(random): stop silent entropy loss and reader livelocks, correct false docs, and make the tests pin real behavior

The core generation logic was correct and is unchanged. This fixes the ways a caller could be silently harmed, the doc claims that were false, and a test suite that reported 100% coverage while failing to detect a broken UUIDv7.

Caller-reachable defects:

* WithByteToCharMap retained the caller's slice instead of copying it: mutating or clearing that buffer afterwards silently changed the alphabet (clear() turned RandString into a zero-entropy NUL generator), and doing so concurrently was a data race. The map is now copied.
* A degenerate but legal io.Reader could livelock the package: io.ReadFull has no no-progress guard, so a (0, nil) reader spun RandomBytes, RandString and UUIDv7 forever, and RandString's rejection loop hung on a reader whose bytes were all rejected. Both loops are now bounded and report ErrReaderNoProgress. Neither path is reachable with the default crypto/rand.Reader.
* RandString on a zero-value Rnd panicked with a divide-by-zero; the character map is now validated (ErrInvalidCharMap).

New API (additive): WithFallbackHook makes the silent math/rand/v2 substitution observable for custom readers, plus ErrReaderNoProgress and ErrInvalidCharMap.

Documentation corrections (the claims were wrong, not the code): UUIDv7 has 62 random bits, not 80 or ~74, since rand_a is sub-millisecond clock precision (RFC 9562 6.2, Method 3) rather than randomness; io.ReadFull retries a short read rather than treating it as an error; UID64's birthday bound conflated 2^16 (65,536) with ~77k; the Byte helpers allocate only when their result escapes; RandString is byte-oriented, so a multi-byte UTF-8 map yields invalid UTF-8; the UUIDv7 entropy buffer escapes to the heap; and the Format performance and int64-widening claims were overstated.

Tests and benchmarks: the Format/Hex/String tests were tautological (they compared Format agains... (continued)

16830 of 16830 relevant lines covered (100.0%)

4701.83 hits per line

Jobs
ID Job ID Ran Files Coverage
1 29266131380.1 13 Jul 2026 04:26PM UTC 191
100.0
GitHub Action Run
Source Files on build 29266131380
  • Tree
  • List 191
  • Changed 5
  • Source Changed 5
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #29266131380
  • edb9a8be on github
  • Prev Build on main (#29262578350)
  • Next Build on main (#29316991257)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc