change guid byte partition for ipv4 to use only the second and third group of the guid
This commit is contained in:
parent
3fc94a336f
commit
0be549b2de
|
@ -114,7 +114,8 @@ namespace cloud.insecurity.docker.ipam
|
|||
|
||||
if (bytes.Length == 4)
|
||||
{
|
||||
bytes = new byte[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}.Concat(bytes).ToArray();
|
||||
bytes = new byte[] {0, 0, 0, 0}.Concat(bytes).ToArray()
|
||||
.Concat(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0}).ToArray();
|
||||
}
|
||||
|
||||
//bytes = bytes.Select(b => Convert.ToByte(b ^ prefixLen)).ToArray();
|
||||
|
@ -125,17 +126,21 @@ namespace cloud.insecurity.docker.ipam
|
|||
{
|
||||
// https://en.wikipedia.org/wiki/Universally_unique_identifier#History
|
||||
return new Guid(
|
||||
b.ReadUInt32(),
|
||||
b.ReadUInt16(),
|
||||
b.ReadUInt16(),
|
||||
b.ReadUInt32(), // time low
|
||||
b.ReadUInt16(), // time mid
|
||||
b.ReadUInt16(), // time hi and version
|
||||
b.ReadByte(), // clock seq hi and res?
|
||||
b.ReadByte(), // clock seq lo?
|
||||
b.ReadByte(),
|
||||
b.ReadByte(),
|
||||
b.ReadByte(),
|
||||
b.ReadByte(),
|
||||
b.ReadByte(),
|
||||
b.ReadByte(),
|
||||
b.ReadByte(),
|
||||
b.ReadByte());
|
||||
b.ReadByte() /* 48-bit node id */);
|
||||
// however this is RFC4122 (g)UUID and the information
|
||||
// is definitely not relevant but a nice piece of
|
||||
// nostalgia.
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue