Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

hashing algorithm

Name: hasher 2009-06-22 12:14

Hello, I need an hashing algorithm which outputs a hash which doesn't change much if the output doesn't change much.
Ideally if I had string1 which were quite similar to string2, the two hashes should differ by something comparable to the Levenshtein distance.
That's not really important though.
I thought about an homothetic transformation (that is taking each nth character in order to end up with a constant length string), but I don't really know.
Any suggestions?

Name: Anonymous 2009-06-22 12:38

I lol'd

Name: Anonymous 2009-06-22 12:46

First in Google search using the keywords hash similar algorithm.
http://en.wikipedia.org/wiki/Hash_function#Finding_similar_records

Name: hasher 2009-06-22 13:17

@3
I already read that, but I don't think music brainz acoustic fingerprint algorithm is right for text strings...

Name: hasher 2009-06-22 13:19

also @3, I expected a little bit more than a &STARTSQUOTE;wikipedia article&ENDSQUOTE;

Name: !!OLEWaicmZnzzZYR 2009-06-22 13:25

a

Name: test 2009-06-22 13:46

>>6
lol wat?

Name: Anonymous 2009-06-22 13:57

TRY THE IDENTITY FUNCTION.

Name: Anonymous 2009-06-22 14:15

>>3,4
How about you learn how this board works before you post again?

Name: hasher 2009-06-22 14:46

@8
I need constant length.

Name: Anonymous 2009-06-22 14:47

@9
you mean the useless threads on SICP or on the favourite programming language?

Name: Anonymous 2009-06-22 14:57

>>11
a9
back to /twitter/ please

Name: Anonymous 2009-06-22 14:57

s/a9/@9/

Name: Anonymous 2009-06-22 16:01

>>13
s/\@/\\\@/

Name: Anonymous 2009-06-22 17:04

>>14
s/\\/\\\\/

Name: Anonymous 2009-06-22 17:23

>>15
s/\\\\/\\\\\\\\/

Name: Anonymous 2009-06-22 19:39

>>1
homothetic transformation
I read that as homoerotic.

Also, phash.

Name: Anonymous 2009-06-22 20:28

>>17
Hi Xarn, a little disappointed are we?

Name: Anonymous 2009-06-23 8:17

>>18
have you tried not being a butt-munch?

Name: Anonymous 2009-06-23 10:56

>>18
What?
I'm not Xarn.

Name: Anonymous 2009-06-23 11:35

969ee999438c2d4d4de5 - How about you learn how this board works before you post again?
829ee999438c2d4d49e5 - How about you learn how this board works before uoa post again?
d5bed6b9a9ed94b4bc59 - How about you learn how this board works before you post again, faggot?
969ee999438c2d514de5 - How about you learn how this board works before you post egain?
590d9e715e46b09ec9ed - Wow, about time you learn how this board works before you post again!
590d9e715e46b09ee7ed - Wow, about time you learn how this board works before you post again?
bf6e05d8cdbaef9ed40d - Wow, about time you learn how this board works before you post again, faggot?
bf6e05d8cdbad1ddd40d - Wow, about time you learn how this board works before you post again, faggot!?

Name: Anonymous 2009-06-23 15:21


fioc
fico
foic
foci
fcio
fcoi
ifoc
ifco
iofc
iocf
icfo
icof
ofic
ofci
oifc
oicf
ocfi
ocif
cfio
cfoi
cifo
ciof
cofi
coif

Name: Anonymous 2009-06-23 15:34

Tell me how this works:
module WhatHash where

import Char
import Numeric

{-
The [i]homoerotic[/i] hashing algorithm requested in http://dis.4chan.org/read/prog/1245687289
-}

data Binary = Binary [Bool] deriving Eq

xor True = not
xor False = id

pow2s = map (2^) [0..]

intToBin 0 = []
intToBin x = reverse $ que (-1) what
         where que l (y:ys) | y == 0    = False:que y ys
                            | y == x    = [True]
                            | y == l    = False:que y ys
                            | otherwise = True:que y ys
               what = map (mod x) $ tail pow2s

binToInt xs' = binToInt' 0
          where xs = reverse xs'
                binToInt' n | n >= length xs = 0
                            | xs !! n        = (pow2s !! n) + binToInt' (n+1)
                            | otherwise      = binToInt' (n+1)

padl n p list | length list >= n = list
              | otherwise        = padl n p (p:list)

charToByte = padl 8 False . intToBin . ord
byteToChar = chr . binToInt

instance Show Binary where
    show (Binary [])         = ""
    show (Binary (True:xs))  = '1':show (Binary xs)
    show (Binary (False:xs)) = '0':show (Binary xs)

instance Read Binary where
    readsPrec _ xs = [(Binary $ map q xs,"")]
          where q '1' = True
                q _   = False

splitEvery n xs | length next > 0 = this:splitEvery n next
                | otherwise       = [this]
              where (this,next) = splitAt n xs

--(accumulate-n) from SICP Exercise 2.36
foldrn f n []     = []
foldrn f n ([]:_) = []
foldrn f n xs     = foldr f n (q head xs):foldrn f n (q tail xs)
    where q ad = map ad . filter (/=[])

whatHash = foldrn xor True . splitEvery 128

hashStrToBin = whatHash . concatMap charToByte . padl 16 ' '

hashStrToBytes = map byteToChar . splitEvery 8 . hashStrToBin

hashStrToStr = foldr showHex "" . map binToInt . splitEvery 8 . hashStrToBin

Name: Anonymous 2009-06-23 15:46

>>23
magic

Name: Anonymous 2009-06-23 18:12

>>23
Let me clarify: Tell me how well this works for your purpose, >>1.

Name: Anonymous 2013-04-22 22:27

aye

Name: Anonymous 2013-04-23 13:54



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-23 14:05



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-23 14:13



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-23 14:28



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-23 14:40



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-24 0:22



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-24 0:30



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-24 0:35



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-24 0:42



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-24 0:53



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-24 0:59



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-24 1:05



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Don't change these.
Name: Email:
Entire Thread Thread List