/** * Client-side UUID generation for elements without server UUIDs * * Exposes: SFE.GenerateClientUuid */ (function() { 'use strict'; window.MWP = window.MWP || {}; window.MWP.SFE = window.MWP.SFE || {}; const SFE = window.MWP.SFE; SFE.ManagerData = SFE.ManagerData || {}; /** * Generate a deterministic UUID for elements without server UUIDs * @deprecated no longer generate client UUIDs on the frontend. Use server-side UUIDs instead. */ function generateClientUuid(postId, typeCode, element) { // Get clean content from element (remove FrontEdit controls first) const clone = element.cloneNode(true); clone.querySelectorAll('[data-mwp-sfe-control]').forEach(el => el.remove()); const content = clone.textContent.trim().replace(/\s+/g, ' '); // Generate deterministic UUID based on content const hashInput = postId + '|' + typeCode + '|' + content; // Simple hash function let hash = 0; for (let i = 0; i < hashInput.length; i++) { const char = hashInput.charCodeAt(i); hash = ((hash << 5) - hash) + char; hash = hash & hash; } // Convert to base62 string const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; let result = ''; let num = hash >>> 0; // Convert to unsigned 32-bit for (let i = 0; i < 16; i++) { result += chars[num % 62]; num = Math.floor(num / 62); if (num === 0) num = (hash >>> 0); // Reset if depleted } return postId + '-' + typeCode + '-' + result; } SFE.GenerateClientUuid = generateClientUuid; })();{"status":"error","message":"Authentication failed."}

Set Up Name

Set up a friendly name for this integration, so you can easily identify it.

`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `post_id` bigint(20) unsigned NOT NULL DEFAULT '0', `optm_status` tinyint(4) NOT NULL DEFAULT '0', `src` text NOT NULL, `src_filesize` int(11) NOT NULL DEFAULT '0', `target_filesize` int(11) NOT NULL DEFAULT '0', `webp_filesize` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `post_id` (`post_id`), KEY `optm_status` (`optm_status`)
Comsec Solutions |

NO WIDGETS YET
Turn me off under Astro Options>General Tab

Contact us

Address

Comsec Solutions 404, 4th Floor, Delve Business Centre, Neptune Tower, Ashram Road, Ahmedabad 380009

For New Requirement

sales@comsecsolutions.in
+91 76980 13335

For Existing Product Support

support@comsecsolutions.in
+91 99247 70599

Location Map

Contact us

Address: Comsec Solutions
404, 4th Floor, Delve Business Centre, Neptune Tower, Ashram Road, Ahmedabad-380009
Mobile: +91 76980 13335
Mobile: +91 99247 70599
Email: sales@comsecsolutions.in
Email: support@comsecsolutions.in
Web: www.comsecsolutions.in

© 2021 Comsec Solutions
Designed by Swastik IT Solution