What would you think of a "hash" attribute?

Discuss how to use and promote Web standards with the Mozilla Gecko engine.

If you have a website: Would you use it?

Yeah, it would be awesome!
2
25%
Yeah
2
25%
No
3
38%
No. Why on earth would I?
1
13%
 
Total votes: 8

WulfTheSaxon
Posts: 249
Joined: October 18th, 2005, 2:04 pm

What would you think of a "hash" attribute?

Post by WulfTheSaxon »

What would you think about a "hash" attribute for the "a" tag?

It would allow you to pass along an MD5, SHA-1, or other hash to a user-agent for automatic comparison.

An example:

Code: Select all

<a href="http://files.mirror.example/file.exe" hash="md5/9e107d9d372bb6826bd81d3542a419d6">A file</a>


Which would render as: <a href="http://files.mirror.example/file.exe" hash="md5/9e107d9d372bb6826bd81d3542a419d6">A file</a>

As far as the end-user's experience, it would work something like Gervase Markham's "<a href="http://mdhashtool.mozdev.org/lfinfo.html">Link Fingerprints"</a> scheme, but without the user ever having to see the hash string (which can be quite obtrusive)...
Last edited by WulfTheSaxon on November 7th, 2006, 10:03 pm, edited 1 time in total.
Sign the petition to support net neutrality: savetheinternet.com
WulfTheSaxon
Posts: 249
Joined: October 18th, 2005, 2:04 pm

Post by WulfTheSaxon »

Wow, I'm surprised nobody has replied yet...
Sign the petition to support net neutrality: savetheinternet.com
User avatar
BenBasson
Moderator
Posts: 13671
Joined: February 13th, 2004, 5:49 am
Location: London, UK
Contact:

Post by BenBasson »

Probably because this isn't a WHAT-WG mailing list or a web development forum... ;)
User avatar
daihard
Folder@Home
Posts: 16633
Joined: November 17th, 2002, 6:27 pm
Location: Lynnwood, WA
Contact:

Post by daihard »

It is probably more convenient than to have to copy & paste the hash string and run a manual comparison after dowload... :)
Kubuntu 8.04 (kernel 2.6.24-25-generic) / KDE 3.5.10
CentOS 4.8 (kernel 2.6.9-78.0.22.ELsmp) / KDE 3.5.10
Mac OS X 10.6.1 (Snow Leopard) / iPhone 3GS (32GB black)
User avatar
BenBasson
Moderator
Posts: 13671
Joined: February 13th, 2004, 5:49 am
Location: London, UK
Contact:

Post by BenBasson »

How is that more convenient than having the browser do it?
old np
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old np »

Read what he said again, Ben. Don't skip over "than".
User avatar
BenBasson
Moderator
Posts: 13671
Joined: February 13th, 2004, 5:49 am
Location: London, UK
Contact:

Post by BenBasson »

Oops, sorry. Remind me to put caffeine before MozillaZine in my to-do list.
WulfTheSaxon
Posts: 249
Joined: October 18th, 2005, 2:04 pm

Post by WulfTheSaxon »

Argh... The WHAT-WG doesn't have a forum. I hate mailing lists... They're spammy. *starts thinking of a new email address*
Sign the petition to support net neutrality: savetheinternet.com
WulfTheSaxon
Posts: 249
Joined: October 18th, 2005, 2:04 pm

Post by WulfTheSaxon »

Shouldn't this be in "Web Development / Standards Evangelism"?

I guess I didn't see that forum before... Would a moderator please move this thread?

Thanks :)
Sign the petition to support net neutrality: savetheinternet.com
User avatar
shadytrees
Moderator
Posts: 11743
Joined: November 30th, 2002, 6:41 am

Post by shadytrees »

Sure. ::shake shake shake::
WulfTheSaxon
Posts: 249
Joined: October 18th, 2005, 2:04 pm

Post by WulfTheSaxon »

Thanks :)
Sign the petition to support net neutrality: savetheinternet.com
User avatar
BenBasson
Moderator
Posts: 13671
Joined: February 13th, 2004, 5:49 am
Location: London, UK
Contact:

Post by BenBasson »

Better syntax would probably use namespaces, so that multiple algorithms could be used. For example:

md5:hash="9e107d9d372bb6826bd81d3542a419d6"
sha1:hash="..."

Or

md5:hash="/file.hash"

That would ultimately limit this to XHTML, although I suppose that's not really a problem since this is all theoretical and a bit late for HTML4.
User avatar
jqp
Posts: 5070
Joined: November 17th, 2004, 10:56 am
Location: In a box
Contact:

Post by jqp »

What if the hash was always a file, and the type of file tells you the type of hash: hash="check.md5"
What if it wasn't an HTML attribute at all, but instead, an HTTP header: "Hash: 9e107d9d372bb6826bd81d3542a419d6" (deal with multiple algorithms somehow) (this only works in the download is HTTP)
What if hash was the namespace and its attributes are the different types: hash:md5="9e107d9d372bb6826bd81d3542a419d6" (This still alienates HTML)
What if the hash type was included in the attribute value: hash="hash/md5,9e107d9d372bb6826bd81d3542a419d6" (doesn't alienate HTML)
What if the hash type was part of a MIME type parameter: type="application/octet-stream; md5=9e107d9d372bb6826bd81d3542a419d6" (or something... I don't know)

Either way, I think it's a good idea and I'm surprised I haven't seen discussion of anything like that.
User avatar
Nanobot
Posts: 578
Joined: April 28th, 2004, 7:25 pm
Location: California
Contact:

Post by Nanobot »

This should definitely be an HTTP response header rather than an HTML attribute. If you use it as an attribute, there is a very strong chance that at some point the linked file will be modified without the link being updated. If it's an HTTP header, the server can generate the checksum automatically and the webpage author doesn't have to do anything extra.
WulfTheSaxon
Posts: 249
Joined: October 18th, 2005, 2:04 pm

Post by WulfTheSaxon »

Aren't there plenty of ways to automatically modify HTML?
Sign the petition to support net neutrality: savetheinternet.com
Post Reply