Files
Laca-City/backend/node_modules/sha.js/hash.js
PhongPham c65cc97a33 🎯 MapView v2.0 - Global Deployment Ready
 MAJOR FEATURES:
• Auto-zoom intelligence với smart bounds fitting
• Enhanced 3D GPS markers với pulsing effects
• Professional route display với 6-layer rendering
• Status-based parking icons với availability indicators
• Production-ready build optimizations

🗺️ AUTO-ZOOM FEATURES:
• Smart bounds fitting cho GPS + selected parking
• Adaptive padding (50px) cho visual balance
• Max zoom control (level 16) để tránh quá gần
• Dynamic centering khi không có selection

🎨 ENHANCED VISUALS:
• 3D GPS marker với multi-layer pulse effects
• Advanced parking icons với status colors
• Selection highlighting với animation
• Dimming system cho non-selected items

🛣️ ROUTE SYSTEM:
• OpenRouteService API integration
• Multi-layer route rendering (glow, shadow, main, animated)
• Real-time distance & duration calculation
• Visual route info trong popup

📱 PRODUCTION READY:
• SSR safe với dynamic imports
• Build errors resolved
• Global deployment via Vercel
• Optimized performance

🌍 DEPLOYMENT:
• Vercel: https://whatever-ctk2auuxr-phong12hexdockworks-projects.vercel.app
• Bundle size: 22.8 kB optimized
• Global CDN distribution
• HTTPS enabled

💾 VERSION CONTROL:
• MapView-v2.0.tsx backup created
• MAPVIEW_VERSIONS.md documentation
• Full version history tracking
2025-07-20 19:52:16 +07:00

85 lines
1.9 KiB
JavaScript

'use strict';
var Buffer = require('safe-buffer').Buffer;
var toBuffer = require('to-buffer');
// prototype class for hash functions
function Hash(blockSize, finalSize) {
this._block = Buffer.alloc(blockSize);
this._finalSize = finalSize;
this._blockSize = blockSize;
this._len = 0;
}
Hash.prototype.update = function (data, enc) {
/* eslint no-param-reassign: 0 */
data = toBuffer(data, enc || 'utf8');
var block = this._block;
var blockSize = this._blockSize;
var length = data.length;
var accum = this._len;
for (var offset = 0; offset < length;) {
var assigned = accum % blockSize;
var remainder = Math.min(length - offset, blockSize - assigned);
for (var i = 0; i < remainder; i++) {
block[assigned + i] = data[offset + i];
}
accum += remainder;
offset += remainder;
if ((accum % blockSize) === 0) {
this._update(block);
}
}
this._len += length;
return this;
};
Hash.prototype.digest = function (enc) {
var rem = this._len % this._blockSize;
this._block[rem] = 0x80;
/*
* zero (rem + 1) trailing bits, where (rem + 1) is the smallest
* non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize
*/
this._block.fill(0, rem + 1);
if (rem >= this._finalSize) {
this._update(this._block);
this._block.fill(0);
}
var bits = this._len * 8;
// uint32
if (bits <= 0xffffffff) {
this._block.writeUInt32BE(bits, this._blockSize - 4);
// uint64
} else {
var lowBits = (bits & 0xffffffff) >>> 0;
var highBits = (bits - lowBits) / 0x100000000;
this._block.writeUInt32BE(highBits, this._blockSize - 8);
this._block.writeUInt32BE(lowBits, this._blockSize - 4);
}
this._update(this._block);
var hash = this._hash();
return enc ? hash.toString(enc) : hash;
};
Hash.prototype._update = function () {
throw new Error('_update must be implemented by subclass');
};
module.exports = Hash;