IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Calculate short, alphanumeric unique track ID, Ideas for shorter title formatting code?
ojdo
post Jun 14 2012, 23:18
Post #1





Group: Members
Posts: 894
Joined: 18-June 06
From: Germany
Member No.: 31980



I'm searching a short way to uniquely identify any given track in my music collection by a short, unique and alphanumeric ID [A-Za-z0-9-]. (Reason: see signature.)
Ideally, I would like it to be human readable, or at least interpretable, so that a track could at be recognised among a short sequence of those IDs. I have come up with the following title formatting string that I use with foo_dynfil to calculate a field %_uid%:

CODE
$replace(
$if2(%release%,$lower($abbr($ascii(%album artist% %album%),6)))
$right(%date%,2)
$lower($left($abbr($ascii(%title%)),2))
$ifgreater(%totaldiscs%,1,%discnumber%,)%tracknumber%
,-,,?,,'',,",,/,,\,,!,,&,,:,,.,,+,,'(',,')',, ,,@,,'[',,']',,~,,#,,%,,_,,^,,|,,*,,$,)


On my 25000 track database it creates one collision, with an average length of 13.5 characters per song. Has anyone here done something similar already which is a) shorter and/or b) less likely to have collisions?



--------------------
http://freemusi.cc/
Go to the top of the page
+Quote Post
ecko
post Jun 15 2012, 03:56
Post #2





Group: Members
Posts: 19
Joined: 29-June 11
Member No.: 91910



Would this work?

$crc32(%path%)
Go to the top of the page
+Quote Post
ojdo
post Jun 15 2012, 18:02
Post #3





Group: Members
Posts: 894
Joined: 18-June 06
From: Germany
Member No.: 31980



QUOTE (ecko @ Jun 15 2012, 04:56) *
$crc32(%path%)

While it would certainly reduce collision probability dramatically, this approach fails in the category "human readable". Maybe I shouldn't have called it unique ID, but a DIY catalogue number, derived from basic tags like artist, album, disc-/tracknumber, title.


--------------------
http://freemusi.cc/
Go to the top of the page
+Quote Post
r0k
post Jun 16 2012, 15:34
Post #4





Group: Members
Posts: 74
Joined: 8-September 11
Member No.: 93574



You can make a mix of both methods.
Start with some abbreviations as you do, and append a short CRC checksum (eg track title only).
"Human readable" however, seriously reduces the options, and often doesn't mix well with "short".
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd November 2014 - 14:35