def createservicesid(svc):
 uni = ''.join([(c + '\x00') for c in svc])
 sha = hashlib.sha1(uni.upper()).digest()
 dec = list()
 for i in range(5):
  dec.append(struct.unpack('<I', sha[(i * 4):((i * 4) + 4)])[0])
 return ('S-1-5-80-' + '-'.join([str(n) for n in dec]))

def createservicesid ( svc ) : uni = '' . join ( [ ( c + '\x00' ) for c in svc ] ) sha = hashlib . sha1 ( uni . upper ( ) ) . digest ( ) dec = list ( ) for i in range ( 5 ) : dec . append ( struct . unpack ( '<I' , sha [ ( i * 4 ) : ( ( i * 4 ) + 4 ) ] ) [ 0 ] ) return ( 'S-1-5-80-' + '-' . join ( [ str ( n ) for n in dec ] ) )
calculate the service sid .