From: Sergey Matveev Date: Tue, 15 Apr 2025 07:44:40 +0000 (+0300) Subject: Ability to use IP address format X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=00ea83bc980bc71ad200e9139e1071d4fd5b68ca2bea98593cd6502d3805034b;p=keks.git Ability to use IP address format --- diff --git a/tcl/keks.tcl b/tcl/keks.tcl index f645b9b..b0255e9 100755 --- a/tcl/keks.tcl +++ b/tcl/keks.tcl @@ -28,6 +28,7 @@ proc char {v} { add [binary format c $v] } +# Just add a raw value. proc RAW {v} { upvar buf buf add $v @@ -54,7 +55,7 @@ proc TRUE {} { } proc HEXLET {v} { - set v [binary decode hex [string map {- ""} $v]] + set v [binary decode hex [string map {- "" : ""} $v]] if {[string length $v] != 16} { error "bad len" } diff --git a/tcl/test-vector.tcl b/tcl/test-vector.tcl index 3dbcf08..f63b061 100644 --- a/tcl/test-vector.tcl +++ b/tcl/test-vector.tcl @@ -67,7 +67,7 @@ MAP { {TAI64 1234567890 456789 123456789} }} uuid {HEXLET 0e875e3f-d385-49eb-87b4-be42d641c367} - ip {HEXLET 20010db8-85a3-08d3-1319-8a2e03707348} + ip {HEXLET 2001:0db8:85a3:08d3:1319:8a2e:0370:7348} } puts [binary encode hex $buf]