Version Numbers, Byte Sizes, and String Manipulation for Developers

Semantic version comparison, byte size formatting, string repetition, and Levenshtein distance — four small but frequently needed developer utilities.

These four utilities solve small but constantly recurring problems in software development — comparing versions, displaying sizes, building strings, and measuring text similarity.

Semantic version comparison: which release is newer

Semantic versioning (major.minor.patch) has a strict comparison order — 2.1.0 is newer than 2.0.9, and 3.0.0 is newer than 2.99.99, since major version differences always outrank minor and patch differences regardless of their individual values.

Byte size formatting: making raw byte counts readable

A raw value like 1,572,864 bytes is far more readable as "1.5 MB" — byte formatters repeatedly divide by 1024 (or 1000, depending on convention) to find the largest unit that keeps the displayed number reasonably sized.

String repetition: building repeated patterns

Repeating a string n times is a common building block for padding, generating test data, or building simple ASCII patterns — "ab" repeated 3 times becomes "ababab".

Levenshtein distance: measuring how different two strings are

Levenshtein (edit) distance counts the minimum number of single-character insertions, deletions, or substitutions needed to turn one string into another. It's the algorithm behind spell-checkers, fuzzy search, and "did you mean...?" suggestions.

Small utilities, constant use

None of these are complex algorithms, but all four show up constantly in day-to-day development work. Try the semver comparator, byte size formatter, string repeat calculator, and Levenshtein distance calculator.