SID hash

Elrond elrond at samba.org
Mon Aug 7 16:37:40 GMT 2000


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?


    Elrond




More information about the samba-technical mailing list