Get templateHash for static tile request and errored named map instantiations

This commit is contained in:
Daniel García Aubert
2020-04-30 13:09:12 +02:00
parent 8d73571f5b
commit a196a26ab4
4 changed files with 32 additions and 12 deletions
+7 -4
View File
@@ -511,12 +511,15 @@ TemplateMaps.prototype.instance = function (template, params) {
// Return a fingerPrint of the object
TemplateMaps.prototype.fingerPrint = function (template) {
return crypto.createHash('md5')
.update(JSON.stringify(template))
.digest('hex')
;
return fingerPrint(template);
};
function fingerPrint (template) {
return crypto.createHash('md5').update(JSON.stringify(template)).digest('hex');
}
module.exports.fingerPrint = fingerPrint;
module.exports.templateName = function templateName (templateId) {
var templateIdTokens = templateId.split('@');
var name = templateIdTokens[0];