encoding - PHP: Need the lightest/most-efficient way to generate a signature from a string -


quick summary/straight point:

what's lightest , fastest way convert large block of html code/text/data short signature string?

i tried $data_signature = md5($htmloutput);

where $htmloutput html formatted table w/ 100 rows of name, age, address data.. , resulted in nice short string: $data_signature = 'e33fbcb944648eca3d5ce9ed69bfd3cc1391648400';

w/c need, since app running every second (data refresh) interested know if there's better way of doing this, has minimal processing impact on server (if ever md5 processor hungry - dont know) .. or "ok" already?

worth noting: not need safety/encryption, need way create signature of output comparative purposes.

details (just wondering)

i have web app (jquery) loading json data php.

json data coming 2 objects: status="ok" output= html formatted output (rows of divs etc)

the web app reloads data php every second... , writes html output div on page = typical.

but make app more efficient, wanted reload if needs to.

i wanted add 3rd object in mix tells app if there's reason update (like new row)

at moment have 3rd object:

$latest_signature = unix timestamp latest row in database table

this value passed , forth jquery sends php on every load, php evaluates , loads/outputs if there's new row in db, , passes new latest_signature value w/ updated epoch time generates output.

so instead of reloading same data, whole thing refresh / reload /rerender when there's new row.

this works , processor-efficient except doesn't account updates done existing rows! lol .. when row in database updated, display not refresh, until new row inserted.

so, thought of doing creating signature whole block of html output.. convert sort of encoding represents whole block of output..

thanks guys!


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -