From af09a86e71c6215f2e3aa3ee09e37b734693b88c Mon Sep 17 00:00:00 2001 From: lilleman Date: Thu, 27 Aug 2026 23:18:20 +0200 Subject: [PATCH] Express hex-shaped data with the hex() builtin instead of a hand-rolled choice --- data/en_US/ip.json | 3 +-- data/misc/mac.json | 5 +---- data/misc/uuid.json | 5 ++--- data/sv_SE/ip.json | 3 +-- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/data/en_US/ip.json b/data/en_US/ip.json index 67191c7..2f071a7 100644 --- a/data/en_US/ip.json +++ b/data/en_US/ip.json @@ -5,7 +5,6 @@ "o": [{ "format": "0", "weight": 3 }, { "format": "10", "weight": 4 }, { "format": "#100", "weight": 2 }] }, { - "format": "{g}:{g}:{g}:{g}:{g}:{g}:{g}:{g}", - "g": [{ "format": "{x}{x}{x}{x}", "x": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"] }] + "format": "{hex(4)}:{hex(4)}:{hex(4)}:{hex(4)}:{hex(4)}:{hex(4)}:{hex(4)}:{hex(4)}" } ] diff --git a/data/misc/mac.json b/data/misc/mac.json index 318a66f..4b3d5b1 100644 --- a/data/misc/mac.json +++ b/data/misc/mac.json @@ -1,6 +1,3 @@ [ - { - "format": "{x}{x}:{x}{x}:{x}{x}:{x}{x}:{x}{x}:{x}{x}", - "x": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"] - } + { "format": "{hex(2)}:{hex(2)}:{hex(2)}:{hex(2)}:{hex(2)}:{hex(2)}" } ] diff --git a/data/misc/uuid.json b/data/misc/uuid.json index 3508c93..18cbf98 100644 --- a/data/misc/uuid.json +++ b/data/misc/uuid.json @@ -1,7 +1,6 @@ [ { - "format": "{x}{x}{x}{x}{x}{x}{x}{x}-{x}{x}{x}{x}-4{x}{x}{x}-{y}{x}{x}{x}-{x}{x}{x}{x}{x}{x}{x}{x}{x}{x}{x}{x}", - "x": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"], - "y": ["8", "9", "a", "b"] + "format": "{hex(8)}-{hex(4)}-4{hex(3)}-{variant}{hex(3)}-{hex(12)}", + "variant": ["8", "9", "a", "b"] } ] diff --git a/data/sv_SE/ip.json b/data/sv_SE/ip.json index 67191c7..2f071a7 100644 --- a/data/sv_SE/ip.json +++ b/data/sv_SE/ip.json @@ -5,7 +5,6 @@ "o": [{ "format": "0", "weight": 3 }, { "format": "10", "weight": 4 }, { "format": "#100", "weight": 2 }] }, { - "format": "{g}:{g}:{g}:{g}:{g}:{g}:{g}:{g}", - "g": [{ "format": "{x}{x}{x}{x}", "x": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"] }] + "format": "{hex(4)}:{hex(4)}:{hex(4)}:{hex(4)}:{hex(4)}:{hex(4)}:{hex(4)}:{hex(4)}" } ]