able
about
above
abuse
accept
accuse
across
act
actor
add
admit
adult
advise
affect
afraid
after
again
against
age
agency
ago
agree
aid
aim
air
airport
album
alcohol
alive
all
ally
almost
alone
along
already
also
always
amend
among
amount
anarchy
ancient
and
anger
animal
another
answer
any
appeal
appear
appoint
approve
area
argue
arms
army
around
arrest
arrive
art
ash
ask
assist
asylum
attach
attack
attempt
attend
autumn
average
avoid
awake
award
away
baby
back
bad
balance
ball
balloon
ballot
ban
bank
bar
barrier
base
battle
beat
beauty
because
become
bed
before
begin
behind
believe
belong
below
best
betray
better
between
big
bill
biology
bird
bite
black
blame
bleed
blind
block
blood
blow
blue
boat
body
boil
bomb
bone
book
border
born
borrow
both
bottle
bottom
box
boy
boycott
brain
brave
bread
break
breathe
bridge
brief
bright
bring
brother
brown
budget
build
bullet
burn
burst
bury
bus
busy
but
buy
cabinet
call
calm
camera
camp
can
cancel
cancer
capital
capture
car
care
career
careful
carry
case
cat
catch
cause
center
century
chance
change
charge
chase
cheat
cheer
chief
child
choose
circle
citizen
city
civil
rights
claim
clash
class
clean
clear
clergy
climate
climb
clock
close
cloth
clothes
cloud
coal
coast
coffee
cold
collect
college
colony
color
combine
come
command
comment
common
company
compare
compete
complex
concern
condemn
confirm
connect
contact
contain
control
cook
cool
copy
corn
correct
cost
cotton
count
country
court
cover
cow
crash
create
credit
crew
crime
crisis
crops
cross
crowd
crush
cry
culture
cure
curfew
current
custom
customs
cut
dam
damage
dance
danger
dark
date
day
dead
deaf
deal
debate
debt
decide
declare
deep
defeat
defend
deficit
define
degree
delay
demand
deny
depend
deplore
deploy
desert
design
desire
destroy
detail
detain
develop
device
die
diet
dig
dinner
direct
dirt
disarm
discuss
disease
dismiss
dispute
dive
divide
doctor
dog
dollar
donate
door
double
down
dream
drink
drive
drop
drown
drug
dry
during
dust
duty
each
early
earn
earth
e...
JavaScript
function digest(text){
var array = text.split("");
var total = 0;
for(var i = 0; i < array.length; i++){
var int = array[i].charCodeAt(0);
total = ((total + int) ^ 23) - (total/31);
}
return total.toString().replace(".", "");
}
var text = document.body.innerText;
var words = text.split(" ");
var obj = {};
var hits = [];
var collisions = 0;
for(var i = 0; i < words.length; i++){
var hash = digest(words[i]);
if(hits.indexOf(hash) == -1){
hits.push(hash);
}
if(obj[hash] == null){
obj[hash] = {
count: 1,
list: [words[i]]
};
} else {
obj[hash].count++;
obj[hash].list.push(words[i]);
}
}
for(var i = 0; i < hits.length; i++){
var count = obj[hits[i]].count;
if(count > 1){
collisions += obj[hits[i]].count;
console.log(obj[hits[i]].list);
}
}
alert("Collisions: " + collisions + "\nTotal words: " + words.length + "\n\nThats " + ((collisions/words.length) * 100).toFixed(1) + "%");
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.