SID hash

Cole, Timothy D. timothy_d_cole at
Mon Aug 7 17:26:00 GMT 2000

> -----Original Message-----
> From:	Elrond [SMTP:elrond at]
> Sent:	Monday, August 07, 2000 12:38
> To:	Cole, Timothy D.
> Cc:	'samba-technical at'
> Subject:	Re: SID hash
> On Mon, Aug 07, 2000 at 10:52:28AM -0400, Cole, Timothy D. wrote:
> > Anyone happen to have a good hash function for SIDs handy?
> Hmmm...
> They mostly look like this:
> S-1-5-21-548288470-1393064207-929701000-1110
> The 3 numbers in the middle are completely random, the last
> one is incremented on NT and calculated from the UID in a
> linear way on samba.
> So if you need a hash: Add them all up. You will get a
> different hash for every user in one domain and different
> domains have different base offsets, because their random
> numbers at the beginning will be different.
> Or does your hash need to have special characteristics? For
> example, do you want a hash in the cryptographic sense?
> Then your best bet is running MD5/SHA1 against the string
> or the binary data. ;)
> BTW: For what do you need a hash?
	Oh.  Heh, yes.  The definition of "good hash" varies greatly
depending on the application :P

	Eh, in this case, for use in a hashtable, probably sorted linear for
the moment.

More information about the samba-technical mailing list