-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
44 lines (39 loc) · 1.08 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html>
<body>
<script>
function testall(){
var sizes = [10,100,1000,2000,2025,2050,2100,2250,2500,2750,3000,4000,5000,10000, 50000];
for (var i = 0; i < sizes.length; i++) {
var n = sizes[i];
if(!testhash(n)){
var elem = document.createElement("div");
elem.innerHTML = '<div style="font-size:25px;">failed at: "+n+"</div>';
document.body.appendChild(elem);
return
}
}
var elem = document.createElement("div");
elem.innerHTML = '<div style="font-size:25px;">SUCCESS!!</div>';
document.body.appendChild(elem);
}
function testhash(n){
var somestring = "#" + makestring(n);
window.location.hash = somestring;
var success = (window.location.hash == somestring);
return success
}
function makestring(n){
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for( var i=0; i < n; i++ ){
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
}
document.body.onload = function(){
testall()
}
</script>
</body>
</html>