Coverage for /private/tmp/im/impacket/impacket/uuid.py : 76%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved. # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # Description: # Generate UUID compliant with http://www.webdav.org/specs/draft-leach-uuids-guids-01.txt. # A different, much simpler (not necessarily better) algorithm is used. # # Author: # Javier Kohen (jkohen) #
# UHm... crappy Python has an maximum integer of 2**31-1.
return
#input: string #output: tuple (uuid,version) #if version is not found in the input string "1.0" is returned #example: # "00000000-0000-0000-0000-000000000000 3.0" returns ('00000000-0000-0000-0000-000000000000','3.0') # "10000000-2000-3000-4000-500000000000 version 3.0" returns ('00000000-0000-0000-0000-000000000000','3.0') # "10000000-2000-3000-4000-500000000000 v 3.0" returns ('00000000-0000-0000-0000-000000000000','3.0') # "10000000-2000-3000-4000-500000000000" returns ('00000000-0000-0000-0000-000000000000','1.0') g = re.search("([A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}).*?([0-9]{1,5}\.[0-9]{1,5})",s+" 1.0") if g: (u,v) = g.groups() return (u,v) return
uuid, (maj, min) = tup return "%s v%d.%d" % (uuid, maj, min) |