Robin Becker <[EMAIL PROTECTED]> writes:
> whether it's any better than using the lowest bits I have no real
> idea. I suppose (sha being flavour of the month) I should really use
I think if you have more than a few fonts you really have to assign
the id's uniquely instead of using hashes, to avoi
> If the UniqueID is used it must be unique when used in the printer
> (where I cannot control which other UniqueID's might be present).
I don't know much about PostScript; googling around gives
http://fontforge.sourceforge.net/UniqueID.html
that says that you should not use them anymore, and
h
Martin v. Löwis wrote:
..
>> ie a bunch of lists of strings which are eventually joined together and
>> written out with a template to make the postscript definition.
>
> And the UniqueID should be unique within this file, right?
>
> Why don't you just use a serial number then?
..
I d
> I'm trying to create UniqueID's for dynamic postscript fonts. According
> to my resources we don't actually need to use these, but if they are
> required by a particular postscript program (perhaps to make a print run
> efficient) then the private range of these ID's is 400<=UID<=499
> ie
Thomas Jollans wrote:
> Robin Becker wrote:
...
>> I'm not sure my postscript is really good enough to do the latter so I
>> hoped to pursue a python based approach which has a low probability of
>> busting. Originally I thought the range was a 16bit number which is why
>> I started with 16bit
Robin Becker wrote:
> Martin v. Löwis wrote:
>
> 0 the ideal hash
>
> :)
>
> can't be argued with
>
>> ...
>> So: what are your input data, and what is the
>> distribution among them?
>>
>> Regards,
>> Martin
>>
> I'm trying to create UniqueID's for dynamic postscript fonts. According
> to
Martin v. Löwis wrote:
0 the ideal hash
:)
can't be argued with
>...
> So: what are your input data, and what is the
> distribution among them?
>
> Regards,
> Martin
>
I'm trying to create UniqueID's for dynamic postscript fonts. According to my
resources we don't actually need to use th
"Martin v. Löwis" <[EMAIL PROTECTED]> writes:
> So: what are your input data, and what is the
> distribution among them?
With good enough hash functions one shouldn't need to care about
the input distribution. Basically functions like SHA can be
used as extractors:
http://en.wikipedia.org/wik
> Is the any way to get an efficient 16bit hash in python?
Unfortunately, that problem is underspecified. The simplest
and most efficient 16-bit hash I can come up with is
def super_efficient_hash(o):
return 0
Now, you say: this gives collisions.
So yes, it does - but you didn't ask for it to
Robin Becker <[EMAIL PROTECTED]> writes:
> >> Is the any way to get an efficient 16bit hash in python?
> > hash(obj)&65535
> > - Josiah
> yes I thought of that, but cannot figure out if the internal hash
> really distributes the bits evenly. Particularly since it seems to
> treat integers etc as
On Jun 27, 12:11 pm, Robin Becker <[EMAIL PROTECTED]> wrote:
> Josiah Carlson wrote:
> > Robin Becker wrote:
> >> Is the any way to get an efficient 16bit hash in python?
>
> > hash(obj)&65535
>
> > - Josiah
>
> yes I thought of that, but cannot figure out if the internal hash really
> distribute
On 2007-06-27, Robin Becker <[EMAIL PROTECTED]> wrote:
> Is the any way to get an efficient 16bit hash in python?
int(md5.new(s).hexdigest()[:4], 16) ?
--
http://mail.python.org/mailman/listinfo/python-list
Robin Becker schrieb:
> Josiah Carlson wrote:
>> Robin Becker wrote:
>>> Is the any way to get an efficient 16bit hash in python?
>>
>> hash(obj)&65535
>>
>> - Josiah
> yes I thought of that, but cannot figure out if the internal hash really
> distributes the bits evenly. Particularly since it
Robin Becker <[EMAIL PROTECTED]> wrote:
> Is the any way to get an efficient 16bit hash in python?
Here is a 32 bit crc of which you could use the bottom 16 bits as a 16
bit hash...
>>> import binascii
>>> binascii.crc32("hello world")
222957957
>>> crc = binascii.crc32("hello")
>>> cr
Josiah Carlson wrote:
> Robin Becker wrote:
>> Is the any way to get an efficient 16bit hash in python?
>
> hash(obj)&65535
>
> - Josiah
yes I thought of that, but cannot figure out if the internal hash really
distributes the bits evenly. Particularly since it seems to treat integers etc
as s
Robin Becker wrote:
> Is the any way to get an efficient 16bit hash in python?
hash(obj)&65535
- Josiah
--
http://mail.python.org/mailman/listinfo/python-list
16 matches
Mail list logo