Skip to content

Commit 3f444a5

Browse files
author
Vladimir Kotal
committed
fix delta == 1 case: version 1.0
1 parent c908497 commit 3f444a5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
1.0 - fixed bug in the algorithm allocating bits from the middle when
3+
the delta was only 1 bit
24
0.9 - fixed bug centermost algorithm :
35
at the very first round the bit following the center for the even
46
number of bits was not picked

ipv6gen.pl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,12 @@ ()
393393
$str = reverse $str;
394394
$str = $tmp . $str;
395395
} else {
396-
$str = $str . "1";
396+
# This will take care of the delta == 1 case
397+
if ($i == 0) {
398+
$str = "1";
399+
} else {
400+
$str = $str . "1";
401+
}
397402
$str = &zero_pad($str, $central_bit, 1);
398403
}
399404
$str = &zero_pad($str, $delta, 0);

0 commit comments

Comments
 (0)